I am trying to implement MembershipProvider with IoC described in this article: http://bugsquash.blogspot.cz/2010/11/windsor-managed-membershipproviders.html
But I have some problems with my MvcApplication class which is implementing IContainerAccessor. But when I am trying to access the container by following code in MyMembershipProvider the container is null reference.
(HttpContext.Current.ApplicationInstance as IContainerAccessor).Container
I found that there is second instance of MvcApplication which method Application_Start() was not called. Therefore no instance was set to Container property.
Why there is second instance of MvcApplication class? I thought that there will be only one instance. And how come that Application_Start() was not called?
I am using .net4 and mvc3.