Error after Enabling or Disabling Features

Topics: Customizing Orchard, Installing Orchard, Troubleshooting
Mar 9, 2011 at 11:13 PM

I'm having a problem every time that I try to Enable or Disable some feature of my Orchard site, it shows me the following YSOD:  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.InvalidOperationException: Sequence contains more than one matching element

Source Error:

<!-- [InvalidOperationException]: Sequence contains more than one matching element at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate) at Orchard.Environment.State.ShellStateCoordinator.<>c__DisplayClass21.<Orchard.Environment.State.IShellStateManagerEventHandler.ApplyChanges>b__13(<>f__AnonymousTypea`2 entry) in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Environment\State\ShellStateCoordinator.cs:line 126 at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() at System.Linq.Enumerable.<ConcatIterator>d__71`1.MoveNext() at System.Linq.Buffer`1..ctor(IEnumerable`1 source) at System.Linq.Enumerable.<ReverseIterator>d__a0`1.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() at Orchard.Environment.State.ShellStateCoordinator.Orchard.Environment.State.IShellStateManagerEventHandler.ApplyChanges() in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Environment\State\ShellStateCoordinator.cs:line 158 [TargetInvocationException]: Exception has been thrown by the target of an invocation. at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Orchard.Events.DefaultOrchardEventBus.TryInvokeMethod(IEventHandler eventHandler, Type interfaceType, String methodName, IDictionary`2 arguments, IEnumerable& returnValue) in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Events\DefaultOrchardEventBus.cs:line 82 at Orchard.Events.DefaultOrchardEventBus.TryInvoke(IEventHandler eventHandler, String interfaceName, String methodName, IDictionary`2 arguments, IEnumerable& returnValue) in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Events\DefaultOrchardEventBus.cs:line 71 at Orchard.Events.DefaultOrchardEventBus.TryNotifyHandler(IEventHandler eventHandler, String messageName, String interfaceName, String methodName, IDictionary`2 eventData, Boolean failFast, IEnumerable& returnValue) in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Events\DefaultOrchardEventBus.cs:line 60 at Orchard.Events.DefaultOrchardEventBus.<NotifyHandlers>d__0.MoveNext() in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Events\DefaultOrchardEventBus.cs:line 39 at System.Linq.Buffer`1..ctor(IEnumerable`1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) at Orchard.Events.DefaultOrchardEventBus.Notify(String messageName, IDictionary`2 eventData) in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Events\DefaultOrchardEventBus.cs:line 25 at Orchard.Environment.State.DefaultProcessingEngine.Execute(Entry entry) in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Environment\State\DefaultProcessingEngine.cs:line 90 at Orchard.Environment.State.DefaultProcessingEngine.ExecuteNextTask() in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Environment\State\DefaultProcessingEngine.cs:line 66 at Orchard.Environment.DefaultOrchardHost.EndRequest() in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Environment\DefaultOrchardHost.cs:line 169 at Orchard.Environment.DefaultOrchardHost.Orchard.Environment.IOrchardHost.EndRequest() in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Environment\DefaultOrchardHost.cs:line 70 at Orchard.Web.MvcApplication.Application_EndRequest() in C:\Users\v-ravero\Personal Jobs\Projects\Ravero\Ravero.Web\Global.asax.cs:line 32 [TargetInvocationException]: Exception has been thrown by the target of an invocation. at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at System.Web.Util.ArglessEventHandlerProxy.Callback(Object sender, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -->

Server Error in '/' Application.

Sequence contains more than one matching element

 

Line 30: 
Line 31:         protected void Application_EndRequest() {
Line 32:             _host.EndRequest();
Line 33:         }
Line 34: 


Source File: C:\Users\v-ravero\Personal Jobs\Projects\Ravero\Ravero.Web\Global.asax.cs Line: 32

Stack Trace:

[InvalidOperationException: Sequence contains more than one matching element]
   System.Linq.Enumerable.SingleOrDefault(IEnumerable`1 source, Func`2 predicate) +2690894
   Orchard.Environment.State.<>c__DisplayClass21.<Orchard.Environment.State.IShellStateManagerEventHandler.ApplyChanges>b__13(<>f__AnonymousTypea`2 entry) in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Environment\State\ShellStateCoordinator.cs:126
   System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +151
   System.Linq.<ConcatIterator>d__71`1.MoveNext() +207
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +325
   System.Linq.<ReverseIterator>d__a0`1.MoveNext() +93
   System.Linq.WhereEnumerableIterator`1.MoveNext() +87
   Orchard.Environment.State.ShellStateCoordinator.Orchard.Environment.State.IShellStateManagerEventHandler.ApplyChanges() in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Environment\State\ShellStateCoordinator.cs:158

[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
   Orchard.Events.DefaultOrchardEventBus.TryInvokeMethod(IEventHandler eventHandler, Type interfaceType, String methodName, IDictionary`2 arguments, IEnumerable& returnValue) in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Events\DefaultOrchardEventBus.cs:82
   Orchard.Events.DefaultOrchardEventBus.TryInvoke(IEventHandler eventHandler, String interfaceName, String methodName, IDictionary`2 arguments, IEnumerable& returnValue) in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Events\DefaultOrchardEventBus.cs:71
   Orchard.Events.DefaultOrchardEventBus.TryNotifyHandler(IEventHandler eventHandler, String messageName, String interfaceName, String methodName, IDictionary`2 eventData, Boolean failFast, IEnumerable& returnValue) in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Events\DefaultOrchardEventBus.cs:60
   Orchard.Events.<NotifyHandlers>d__0.MoveNext() in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Events\DefaultOrchardEventBus.cs:39
   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:\TeamCity\Projects\Orchard-1.x\src\Orchard\Events\DefaultOrchardEventBus.cs:25
   Orchard.Environment.State.DefaultProcessingEngine.Execute(Entry entry) in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Environment\State\DefaultProcessingEngine.cs:90
   Orchard.Environment.State.DefaultProcessingEngine.ExecuteNextTask() in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Environment\State\DefaultProcessingEngine.cs:66
   Orchard.Environment.DefaultOrchardHost.EndRequest() in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Environment\DefaultOrchardHost.cs:169
   Orchard.Environment.DefaultOrchardHost.Orchard.Environment.IOrchardHost.EndRequest() in d:\TeamCity\Projects\Orchard-1.x\src\Orchard\Environment\DefaultOrchardHost.cs:70
   Orchard.Web.MvcApplication.Application_EndRequest() in C:\Users\v-ravero\Personal Jobs\Projects\Ravero\Ravero.Web\Global.asax.cs:32

[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.208


That started after I tryed to Install the Module "Contribute.Stars" and "Orchard.Voting". The first one I was unable to install because it was getting compilation errors, the second one installed, but it appeared twice on the Features screens, which I suppose that is the reason for this error to be appearing, but I don't where those features would be registered.

Can you help me?

Best Regards,

Rafa

Aug 21, 2011 at 5:06 AM

Hi ravero, did you solve this problem !

Jan 2, 2012 at 4:04 PM

I got the same error when I installed the module "Contribute.Stars". It was because I was using an older version of Orchard. When installing your modules, make sure they are compatible with the current version of Orchard your running. Just remove the module from the "Modules" folder and try installing a different version.