pa...@pabich.eu
unread,Jan 13, 2015, 7:01:09 PM1/13/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to aut...@googlegroups.com
Hi,
I've been using Autofac in this particular MVC 5 app for over 2 years and everything has been fine. Yesterday I had a problem with the DB which resulted in a lot of SQL exceptions which in turn, this is my guess, managed to put app in a state where it always returns 500 as it can't even start processing requests. Details below. I've seen the is error before but that was at the end of the processing pipeline, not at the beginning. The only explanation I can come up with is that the root container got disposed so Autfac is not able to create child containers(lifetimescopes). Does this ring a bell ?
Thanks a lot
Pawel
Message:
"when trying to create a controller of type 'UserProfileController'. Make sure that the controller has a parameterless public constructor. ---> System.ObjectDisposedException: Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed."
Stack Trace:
" at Autofac.Core.Lifetime.LifetimeScope.BeginLifetimeScope(Object tag)
at Autofac.Integration.Mvc.RequestLifetimeScopeProvider.GetLifetimeScope(Action`1 configurationAction)
at Autofac.Integration.Mvc.AutofacDependencyResolver.GetService(Type serviceType)
at System.Web.Mvc.DefaultControllerFactory.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType)
--- End of inner exception stack trace ---
at System.Web.Mvc.DefaultControllerFactory.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType)
at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)
at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
"