I have a web service running, and it uses Spring.NET for it's IoCness. One of the classes needs to do some stuff when it loads (I'm using AfterPropertiesSet
) and "some stuff" involves a call to ContextRegistry.GetContext()
. The problem is this code in the ContextRegistry
class:
if (rootContextCurrentlyInCreation)
{
throw new InvalidOperationException("root context is currently in creation. You must not call ContextRegistry.GetContext() from e.g. constructors of your singleton objects");
}
How can I have that object register itself to be notified once the context is fully created?