To elaborate it more, maybe you are resolving a PerWebRequest() defined
component out of a web request. Or may be you are resolving
PerWcfOperation() defined component out of a WCF request. Those out of
scope resolutions also include any application start-time (global.asax?)
resolution...

2013/1/31 Krzysztof Kozmic <krzysztof.koz...@gmail.com>

> Without more details it's not really possible to give you an answer better
> then the educated guess "you're using scoped object outside of its scope"
>
> --
> Krzysztof Kozmic
>
> On Thursday, 31 January 2013 at 3:29 PM, mbergal wrote:
>
> I am getting this error with Castle.Windsor 3.1 in a relatively simple
> project. Is there any obvious reason that I am missing for this? Sorry that
> I am not posting more info, just wanted to find out whether anybody's seen
> it before.
>
>
> Server Error in '/' Application.
> ------------------------------
> *Cannot access a disposed object.
> Object name: 'Scope was already disposed. This is most likely a bug in the
> calling code.'.**Description: *An unhandled exception occurred during the
> execution of the current web request. Please review the stack trace for
> more information about the error and where it originated in the code.
>
> *Exception Details: *System.ObjectDisposedException: Cannot access a
> disposed object.
> Object name: 'Scope was already disposed. This is most likely a bug in the
> calling code.'.
>
> *Source Error:*
>
>
> Line 29:                                                         
> requestContext.HttpContext.Request.Path ) );
> Line 30:                 }Line 31:             return 
> (IController)kernel.Resolve( controllerType );Line 32:             }
> Line 33:         }
>
>
> *Source File: *
> C:\Users\Misha\Projects\Workspaces\StoreFrontManagement.WorkSpace\StoreFrontManagement\StoreManagement.Web\WindsorControllerFactory.cs
> *    Line: *31
>
> *Stack Trace:*
>
>
> [ObjectDisposedException: Cannot access a disposed object.
> Object name: 'Scope was already disposed. This is most likely a bug in the 
> calling code.'.]
>    
> Castle.MicroKernel.Lifestyle.ScopedLifestyleManager.GetScope(CreationContext 
> context) +74
>    
> Castle.MicroKernel.Lifestyle.ScopedLifestyleManager.Resolve(CreationContext 
> context, IReleasePolicy releasePolicy) +59
>    Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext 
> context, Boolean requiresDecommission, Boolean instanceRequired, Burden& 
> burden) +213
>    Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext 
> context, Boolean instanceRequired) +23
>    Castle.MicroKernel.Handlers.AbstractHandler.Resolve(CreationContext 
> context) +12
>    
> Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveFromKernelByType(CreationContext
>  context, ComponentModel model, DependencyModel dependency) +243
>    
> Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveFromKernel(CreationContext
>  context, ComponentModel model, DependencyModel dependency) +118
>    
> Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveCore(CreationContext
>  context, ISubDependencyResolver contextHandlerResolver, ComponentModel 
> model, DependencyModel dependency) +320
>    
> Castle.MicroKernel.Resolvers.DefaultDependencyResolver.Resolve(CreationContext
>  context, ISubDependencyResolver contextHandlerResolver, ComponentModel 
> model, DependencyModel dependency) +25
>    
> Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateConstructorArguments(ConstructorCandidate
>  constructor, CreationContext context) +237
>    
> Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext
>  context) +35
>    
> Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext
>  context) +21
>    
> Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext
>  context, Burden burden) +16
>    
> Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext
>  context, Boolean trackedExternally) +40
>    
> Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext 
> context, IReleasePolicy releasePolicy) +17
>    Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext 
> context, Boolean requiresDecommission, Boolean instanceRequired, Burden& 
> burden) +213
>    Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext 
> context, Boolean instanceRequired) +23
>    Castle.MicroKernel.Handlers.AbstractHandler.Resolve(CreationContext 
> context) +12
>    Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type 
> service, IDictionary additionalArguments, IReleasePolicy policy) +107
>    
> Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type
>  service, IDictionary arguments, IReleasePolicy policy) +42
>    Castle.MicroKernel.DefaultKernel.Resolve(Type service) +13
>    
> StoreManagement.Web.WindsorControllerFactory.GetControllerInstance(RequestContext
>  requestContext, Type controllerType) in 
> C:\Users\Misha\Projects\Workspaces\StoreFrontManagement.WorkSpace\StoreFrontManagement\StoreManagement.Web\WindsorControllerFactory.cs:31
>    System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext 
> requestContext, String controllerName) +74
>    System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, 
> IController& controller, IControllerFactory& factory) +197
>    System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, 
> AsyncCallback callback, Object state) +49
>    System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, 
> AsyncCallback callback, Object state) +50
>    
> System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext
>  context, AsyncCallback cb, Object extraData) +16
>    
> System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
>  +301
>    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& 
> completedSynchronously) +155
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Castle Project Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to castle-project-users+unsubscr...@googlegroups.com.
> To post to this group, send email to castle-project-users@googlegroups.com
> .
> Visit this group at
> http://groups.google.com/group/castle-project-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Castle Project Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to castle-project-users+unsubscr...@googlegroups.com.
> To post to this group, send email to castle-project-users@googlegroups.com
> .
> Visit this group at
> http://groups.google.com/group/castle-project-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Berke SOKHAN.

http://twitter.com/berkesokhan
http://blog.berkesokhan.com

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to castle-project-users+unsubscr...@googlegroups.com.
To post to this group, send email to castle-project-users@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to