Added IEventHandler to an Interface and now I get no scope matching

Topics: Troubleshooting, Writing modules
Developer
Sep 25, 2011 at 10:11 AM

Hi All, I am havign some problems with the IEventHandler, I seem to be recieving this error... eny ideas?

 

Server Error in '/OrchardLocal' Application.

No scope matching the expression 'value(Autofac.Builder.RegistrationBuilder`3+<>c__DisplayClass0[System.Object,Autofac.Builder.ConcreteReflectionActivatorData,Autofac.Builder.SingleRegistrationStyle]).lifetimeScopeTag.Equals(scope.Tag)' is visible from the scope in which the instance was requested.

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: Autofac.Core.DependencyResolutionException: No scope matching the expression 'value(Autofac.Builder.RegistrationBuilder`3+<>c__DisplayClass0[System.Object,Autofac.Builder.ConcreteReflectionActivatorData,Autofac.Builder.SingleRegistrationStyle]).lifetimeScopeTag.Equals(scope.Tag)' is visible from the scope in which the instance was requested.

Source Error:

Line 34:             string methodName = parameters[1];
Line 35: 
Line 36:             var eventHandlers = _eventHandlers();
Line 37:             foreach (var eventHandler in eventHandlers) {
Line 38:                 IEnumerable returnValue;


Source File: D:\onestop\babeland\Orchard\src\Orchard\Events\DefaultOrchardEventBus.cs    Line: 36

Stack Trace:

[DependencyResolutionException: No scope matching the expression 'value(Autofac.Builder.RegistrationBuilder`3+<>c__DisplayClass0[System.Object,Autofac.Builder.ConcreteReflectionActivatorData,Autofac.Builder.SingleRegistrationStyle]).lifetimeScopeTag.Equals(scope.Tag)' is visible from the scope in which the instance was requested.]
   Autofac.Core.Lifetime.MatchingScopeLifetime.FindScope(ISharingLifetimeScope mostNestedVisibleScope) +228
   Autofac.Core.Resolving.ComponentActivation..ctor(IComponentRegistration registration, IResolveOperation context, ISharingLifetimeScope mostNestedVisibleScope) +170
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +212
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Core.Activators.Reflection.<>c__DisplayClass2.<CanSupplyValue>b__0() +68
   Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +157
   Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +416
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.<>c__DisplayClass1.<Execute>b__0() +39
   Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +151
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +315
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Features.Collections.<>c__DisplayClass6.<RegistrationsFor>b__1(IComponentRegistration cr) +52
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +85
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +217
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +78
   Autofac.Features.Collections.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable`1 p) +233
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +96
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +213
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Core.Registration.<>c__DisplayClass5.<RegistrationsFor>b__2(IComponentContext c, IEnumerable`1 p) +49
   Autofac.Builder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p) +51
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +96
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +213
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Core.Activators.Reflection.<>c__DisplayClass2.<CanSupplyValue>b__0() +68
   Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +157
   Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +416
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.<>c__DisplayClass1.<Execute>b__0() +39
   Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +151
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +315
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Core.Activators.Reflection.<>c__DisplayClass2.<CanSupplyValue>b__0() +68
   Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +157
   Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +416
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.<>c__DisplayClass1.<Execute>b__0() +39
   Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +151
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +315
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Features.Collections.<>c__DisplayClass6.<RegistrationsFor>b__1(IComponentRegistration cr) +52
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +85
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +325
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +78
   Autofac.Features.Collections.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable`1 p) +233
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +96
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +213
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Core.Registration.<>c__DisplayClass5.<RegistrationsFor>b__2(IComponentContext c, IEnumerable`1 p) +49
   Autofac.Builder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p) +51
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +96
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +213
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ResolveOperation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +52
   Autofac.Core.Lifetime.LifetimeScope.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +137
   lambda_method(Closure ) +198
   Orchard.Events.<NotifyHandlers>d__0.MoveNext() in D:\onestop\babeland\Orchard\src\Orchard\Events\DefaultOrchardEventBus.cs:36
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +217
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +78
   Orchard.Events.DefaultOrchardEventBus.Notify(String messageName, IDictionary`2 eventData) in D:\onestop\babeland\Orchard\src\Orchard\Events\DefaultOrchardEventBus.cs:25
   Orchard.Events.EventsInterceptor.Intercept(IInvocation invocation) in D:\onestop\babeland\Orchard\src\Orchard\Events\EventsInterceptor.cs:24
   Castle.DynamicProxy.AbstractInvocation.Proceed() +184
   IOrchardShellEventsProxy8c163471a54143d4ad596e776ea3975b.Activated() +152
   Orchard.Environment.DefaultOrchardShell.Activate() in D:\onestop\babeland\Orchard\src\Orchard\Environment\DefaultOrchardShell.cs:40
   Orchard.Environment.DefaultOrchardHost.ActivateShell(ShellContext context) in D:\onestop\babeland\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:128
   Orchard.Environment.DefaultOrchardHost.<CreateAndActivate>b__4(ShellSettings settings) in D:\onestop\babeland\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:113
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +85
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +217
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +78
   Orchard.Environment.DefaultOrchardHost.BuildCurrent() in D:\onestop\babeland\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:97
   Orchard.Environment.DefaultOrchardHost.Orchard.Environment.IOrchardHost.Initialize() in D:\onestop\babeland\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:64
   Orchard.Web.MvcApplication.HostInitialization(HttpApplication application) in D:\onestop\babeland\Orchard\src\Orchard.Web\Global.asax.cs:48
   Orchard.WarmupStarter.<>c__DisplayClass3.<LaunchStartupThread>b__2(Object state) in D:\onestop\babeland\Orchard\src\Orchard.Startup\Starter.cs:89

[ApplicationException: Error during application initialization]
   Orchard.WarmupStarter.Starter`1.OnBeginRequest(HttpApplication application) in D:\onestop\babeland\Orchard\src\Orchard.Startup\Starter.cs:63
   Orchard.Web.MvcApplication.Application_BeginRequest() in D:\onestop\babeland\Orchard\src\Orchard.Web\Global.asax.cs:29

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +0
   System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +72
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +335
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +28
   System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +19
   System.Web.Util.ArglessEventHandlerProxy.Callback(Object sender, EventArgs e) +57
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75



Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237

 

Server Error in '/OrchardLocal' Application.

No scope matching the expression 'value(Autofac.Builder.RegistrationBuilder`3+<>c__DisplayClass0[System.Object,Autofac.Builder.ConcreteReflectionActivatorData,Autofac.Builder.SingleRegistrationStyle]).lifetimeScopeTag.Equals(scope.Tag)' is visible from the scope in which the instance was requested.

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: Autofac.Core.DependencyResolutionException: No scope matching the expression 'value(Autofac.Builder.RegistrationBuilder`3+<>c__DisplayClass0[System.Object,Autofac.Builder.ConcreteReflectionActivatorData,Autofac.Builder.SingleRegistrationStyle]).lifetimeScopeTag.Equals(scope.Tag)' is visible from the scope in which the instance was requested.

Source Error:

Line 34:             string methodName = parameters[1];
Line 35: 
Line 36:             var eventHandlers = _eventHandlers();
Line 37:             foreach (var eventHandler in eventHandlers) {
Line 38:                 IEnumerable returnValue;

Source File: D:\onestop\babeland\Orchard\src\Orchard\Events\DefaultOrchardEventBus.cs    Line: 36

Stack Trace:

[DependencyResolutionException: No scope matching the expression 'value(Autofac.Builder.RegistrationBuilder`3+<>c__DisplayClass0[System.Object,Autofac.Builder.ConcreteReflectionActivatorData,Autofac.Builder.SingleRegistrationStyle]).lifetimeScopeTag.Equals(scope.Tag)' is visible from the scope in which the instance was requested.]
   Autofac.Core.Lifetime.MatchingScopeLifetime.FindScope(ISharingLifetimeScope mostNestedVisibleScope) +228
   Autofac.Core.Resolving.ComponentActivation..ctor(IComponentRegistration registration, IResolveOperation context, ISharingLifetimeScope mostNestedVisibleScope) +170
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +212
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Core.Activators.Reflection.<>c__DisplayClass2.<CanSupplyValue>b__0() +68
   Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +157
   Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +416
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.<>c__DisplayClass1.<Execute>b__0() +39
   Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +151
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +315
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Features.Collections.<>c__DisplayClass6.<RegistrationsFor>b__1(IComponentRegistration cr) +52
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +85
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +217
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +78
   Autofac.Features.Collections.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable`1 p) +233
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +96
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +213
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Core.Registration.<>c__DisplayClass5.<RegistrationsFor>b__2(IComponentContext c, IEnumerable`1 p) +49
   Autofac.Builder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p) +51
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +96
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +213
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Core.Activators.Reflection.<>c__DisplayClass2.<CanSupplyValue>b__0() +68
   Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +157
   Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +416
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.<>c__DisplayClass1.<Execute>b__0() +39
   Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +151
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +315
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Core.Activators.Reflection.<>c__DisplayClass2.<CanSupplyValue>b__0() +68
   Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +157
   Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +416
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.<>c__DisplayClass1.<Execute>b__0() +39
   Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +151
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +315
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Features.Collections.<>c__DisplayClass6.<RegistrationsFor>b__1(IComponentRegistration cr) +52
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +85
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +325
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +78
   Autofac.Features.Collections.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable`1 p) +233
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +96
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +213
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Core.Registration.<>c__DisplayClass5.<RegistrationsFor>b__2(IComponentContext c, IEnumerable`1 p) +49
   Autofac.Builder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p) +51
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +96
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +213
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ResolveOperation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +52
   Autofac.Core.Lifetime.LifetimeScope.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +137
   lambda_method(Closure ) +198
   Orchard.Events.<NotifyHandlers>d__0.MoveNext() in D:\onestop\babeland\Orchard\src\Orchard\Events\DefaultOrchardEventBus.cs:36
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +217
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +78
   Orchard.Events.DefaultOrchardEventBus.Notify(String messageName, IDictionary`2 eventData) in D:\onestop\babeland\Orchard\src\Orchard\Events\DefaultOrchardEventBus.cs:25
   Orchard.Events.EventsInterceptor.Intercept(IInvocation invocation) in D:\onestop\babeland\Orchard\src\Orchard\Events\EventsInterceptor.cs:24
   Castle.DynamicProxy.AbstractInvocation.Proceed() +184
   IOrchardShellEventsProxy8c163471a54143d4ad596e776ea3975b.Activated() +152
   Orchard.Environment.DefaultOrchardShell.Activate() in D:\onestop\babeland\Orchard\src\Orchard\Environment\DefaultOrchardShell.cs:40
   Orchard.Environment.DefaultOrchardHost.ActivateShell(ShellContext context) in D:\onestop\babeland\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:128
   Orchard.Environment.DefaultOrchardHost.<CreateAndActivate>b__4(ShellSettings settings) in D:\onestop\babeland\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:113
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +85
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +217
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +78
   Orchard.Environment.DefaultOrchardHost.BuildCurrent() in D:\onestop\babeland\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:97
   Orchard.Environment.DefaultOrchardHost.Orchard.Environment.IOrchardHost.Initialize() in D:\onestop\babeland\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:64
   Orchard.Web.MvcApplication.HostInitialization(HttpApplication application) in D:\onestop\babeland\Orchard\src\Orchard.Web\Global.asax.cs:48
   Orchard.WarmupStarter.<>c__DisplayClass3.<LaunchStartupThread>b__2(Object state) in D:\onestop\babeland\Orchard\src\Orchard.Startup\Starter.cs:89

[ApplicationException: Error during application initialization]
   Orchard.WarmupStarter.Starter`1.OnBeginRequest(HttpApplication application) in D:\onestop\babeland\Orchard\src\Orchard.Startup\Starter.cs:63
   Orchard.Web.MvcApplication.Application_BeginRequest() in D:\onestop\babeland\Orchard\src\Orchard.Web\Global.asax.cs:29

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +0
   System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +72
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +335
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +28
   System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +19
   System.Web.Util.ArglessEventHandlerProxy.Callback(Object sender, EventArgs e) +57
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237

 

 

 

 

Server Error in '/OrchardLocal' Application.

No scope matching the expression 'value(Autofac.Builder.RegistrationBuilder`3+<>c__DisplayClass0[System.Object,Autofac.Builder.ConcreteReflectionActivatorData,Autofac.Builder.SingleRegistrationStyle]).lifetimeScopeTag.Equals(scope.Tag)' is visible from the scope in which the instance was requested.

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: Autofac.Core.DependencyResolutionException: No scope matching the expression 'value(Autofac.Builder.RegistrationBuilder`3+<>c__DisplayClass0[System.Object,Autofac.Builder.ConcreteReflectionActivatorData,Autofac.Builder.SingleRegistrationStyle]).lifetimeScopeTag.Equals(scope.Tag)' is visible from the scope in which the instance was requested.

Source Error:

Line 34:             string methodName = parameters[1];
Line 35: 
Line 36:             var eventHandlers = _eventHandlers();
Line 37:             foreach (var eventHandler in eventHandlers) {
Line 38:                 IEnumerable returnValue;

Source File: D:\onestop\babeland\Orchard\src\Orchard\Events\DefaultOrchardEventBus.cs    Line: 36

Stack Trace:

[DependencyResolutionException: No scope matching the expression 'value(Autofac.Builder.RegistrationBuilder`3+<>c__DisplayClass0[System.Object,Autofac.Builder.ConcreteReflectionActivatorData,Autofac.Builder.SingleRegistrationStyle]).lifetimeScopeTag.Equals(scope.Tag)' is visible from the scope in which the instance was requested.]
   Autofac.Core.Lifetime.MatchingScopeLifetime.FindScope(ISharingLifetimeScope mostNestedVisibleScope) +228
   Autofac.Core.Resolving.ComponentActivation..ctor(IComponentRegistration registration, IResolveOperation context, ISharingLifetimeScope mostNestedVisibleScope) +170
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +212
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Core.Activators.Reflection.<>c__DisplayClass2.<CanSupplyValue>b__0() +68
   Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +157
   Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +416
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.<>c__DisplayClass1.<Execute>b__0() +39
   Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +151
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +315
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Features.Collections.<>c__DisplayClass6.<RegistrationsFor>b__1(IComponentRegistration cr) +52
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +85
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +217
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +78
   Autofac.Features.Collections.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable`1 p) +233
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +96
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +213
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Core.Registration.<>c__DisplayClass5.<RegistrationsFor>b__2(IComponentContext c, IEnumerable`1 p) +49
   Autofac.Builder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p) +51
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +96
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +213
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Core.Activators.Reflection.<>c__DisplayClass2.<CanSupplyValue>b__0() +68
   Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +157
   Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +416
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.<>c__DisplayClass1.<Execute>b__0() +39
   Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +151
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +315
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Core.Activators.Reflection.<>c__DisplayClass2.<CanSupplyValue>b__0() +68
   Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +157
   Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +416
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.<>c__DisplayClass1.<Execute>b__0() +39
   Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +151
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +315
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Features.Collections.<>c__DisplayClass6.<RegistrationsFor>b__1(IComponentRegistration cr) +52
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +85
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +325
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +78
   Autofac.Features.Collections.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable`1 p) +233
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +96
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +213
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +61
   Autofac.Core.Registration.<>c__DisplayClass5.<RegistrationsFor>b__2(IComponentContext c, IEnumerable`1 p) +49
   Autofac.Builder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p) +51
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +96
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +91
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +213
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +248
   Autofac.Core.Resolving.ResolveOperation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +52
   Autofac.Core.Lifetime.LifetimeScope.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +137
   lambda_method(Closure ) +198
   Orchard.Events.<NotifyHandlers>d__0.MoveNext() in D:\onestop\babeland\Orchard\src\Orchard\Events\DefaultOrchardEventBus.cs:36
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +217
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +78
   Orchard.Events.DefaultOrchardEventBus.Notify(String messageName, IDictionary`2 eventData) in D:\onestop\babeland\Orchard\src\Orchard\Events\DefaultOrchardEventBus.cs:25
   Orchard.Events.EventsInterceptor.Intercept(IInvocation invocation) in D:\onestop\babeland\Orchard\src\Orchard\Events\EventsInterceptor.cs:24
   Castle.DynamicProxy.AbstractInvocation.Proceed() +184
   IOrchardShellEventsProxy8c163471a54143d4ad596e776ea3975b.Activated() +152
   Orchard.Environment.DefaultOrchardShell.Activate() in D:\onestop\babeland\Orchard\src\Orchard\Environment\DefaultOrchardShell.cs:40
   Orchard.Environment.DefaultOrchardHost.ActivateShell(ShellContext context) in D:\onestop\babeland\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:128
   Orchard.Environment.DefaultOrchardHost.<CreateAndActivate>b__4(ShellSettings settings) in D:\onestop\babeland\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:113
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +85
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +217
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +78
   Orchard.Environment.DefaultOrchardHost.BuildCurrent() in D:\onestop\babeland\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:97
   Orchard.Environment.DefaultOrchardHost.Orchard.Environment.IOrchardHost.Initialize() in D:\onestop\babeland\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:64
   Orchard.Web.MvcApplication.HostInitialization(HttpApplication application) in D:\onestop\babeland\Orchard\src\Orchard.Web\Global.asax.cs:48
   Orchard.WarmupStarter.<>c__DisplayClass3.<LaunchStartupThread>b__2(Object state) in D:\onestop\babeland\Orchard\src\Orchard.Startup\Starter.cs:89

[ApplicationException: Error during application initialization]
   Orchard.WarmupStarter.Starter`1.OnBeginRequest(HttpApplication application) in D:\onestop\babeland\Orchard\src\Orchard.Startup\Starter.cs:63
   Orchard.Web.MvcApplication.Application_BeginRequest() in D:\onestop\babeland\Orchard\src\Orchard.Web\Global.asax.cs:29

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +0
   System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +72
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +335
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +28
   System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +19
   System.Web.Util.ArglessEventHandlerProxy.Callback(Object sender, EventArgs e) +57
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237

 

Developer
Sep 25, 2011 at 2:00 PM

Okay found the problem, i had a IUnitOfWorkDependency :(