Error: Operation could destabilize the runtime

Topics: Troubleshooting
Sep 14, 2012 at 9:01 AM

Hi, i have runned an orchard 1.2 site for over a year with a mysql database. My host is Binero.

Yesterday it suddenly stoped working with the stack trace below.

Thankful for any suggestions.

Server Error in '/' Application.

Operation could destabilize the runtime.

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.Security.VerificationException: Operation could destabilize the runtime.

Source Error:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

  <%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
   <system.web>
       <compilation debug="true"/>
   </system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.


Stack Trace:

[VerificationException: Operation could destabilize the runtime.]
   Orchard.ContentManagement.Handlers.ActivatingFilter`1..ctor(String[] contentTypes) +0
   Orchard.Warmup.Handlers.WarmupSettingsPartHandler..ctor(IRepository`1 repository) +85

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +190
   Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +115
   Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +213
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +48
   Autofac.Core.Resolving.<>c__DisplayClass1.<Execute>b__0() +12
   Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +112
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +188
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +176
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +24
   Autofac.Features.Collections.<>c__DisplayClass6.<RegistrationsFor>b__1(IComponentRegistration cr) +17
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +66
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +335
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +77
   Autofac.Features.Collections.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable`1 p) +138
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +62
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +48
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +97
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +176
   Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +24
   Autofac.Core.Registration.<>c__DisplayClass5.<RegistrationsFor>b__2(IComponentContext c, IEnumerable`1 p) +19
   Autofac.Builder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p) +14
   Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +62
   Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters) +48
   Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters) +97
   Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters) +176
   Autofac.Core.Lifetime.LifetimeScope.Resolve(IComponentRegistration registration, IEnumerable`1 parameters) +98
   Autofac.ResolutionExtensions.TryResolve(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance) +70
   Autofac.ResolutionExtensions.Resolve(IComponentContext context, Service service, IEnumerable`1 parameters) +87
   Autofac.ResolutionExtensions.Resolve(IComponentContext context, IEnumerable`1 parameters) +118
   Autofac.ResolutionExtensions.Resolve(IComponentContext context) +75
   Orchard.ContentManagement.DefaultContentManager.get_Handlers() +87
   Orchard.ContentManagement.DefaultContentManager.New(String contentType) +385
   Orchard.ContentManagement.DefaultContentManager.Get(Int32 id, VersionOptions options) +657
   Orchard.ContentManagement.DefaultContentQuery.<Slice>b__0(ContentItemVersionRecord x) +115
   System.Linq.WhereSelectListIterator`2.MoveNext() +104
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +381
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
   Orchard.Utility.Extensions.ReadOnlyCollectionExtensions.ToReadOnlyCollection(IEnumerable`1 enumerable) +102
   Orchard.ContentManagement.DefaultContentQuery.Slice(Int32 skip, Int32 count) +270
   Orchard.ContentManagement.ContentQuery`1.Orchard.ContentManagement.IContentQuery<T>.List() +70
   Orchard.Blogs.Services.BlogService.Get(VersionOptions versionOptions) +230
   Orchard.Blogs.Services.BlogService.Get() +21
   Orchard.Blogs.Routing.BlogPathConstraintUpdator.Refresh() +17
   Orchard.Blogs.Routing.BlogPathConstraintUpdator.Orchard.Environment.IOrchardShellEvents.Activated() +5

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +192
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +108
   System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +19
   Orchard.Events.DefaultOrchardEventBus.TryInvokeMethod(IEventHandler eventHandler, Type interfaceType, String methodName, IDictionary`2 arguments, IEnumerable& returnValue) +361
   Orchard.Events.DefaultOrchardEventBus.TryInvoke(IEventHandler eventHandler, String interfaceName, String methodName, IDictionary`2 arguments, IEnumerable& returnValue) +220
   Orchard.Events.DefaultOrchardEventBus.TryNotifyHandler(IEventHandler eventHandler, String messageName, String interfaceName, String methodName, IDictionary`2 eventData, Boolean failFast, IEnumerable& returnValue) +333
   Orchard.Events.<NotifyHandlers>d__0.MoveNext() +684
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +216
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +77
   Orchard.Events.DefaultOrchardEventBus.Notify(String messageName, IDictionary`2 eventData) +72
   Orchard.Events.EventsInterceptor.Intercept(IInvocation invocation) +516
   Castle.DynamicProxy.AbstractInvocation.Proceed() +73
   IOrchardShellEventsProxyf068f9c571b5425b9cc92d18a0bd4838.Activated() +93
   Orchard.Environment.DefaultOrchardShell.Activate() +372
   Orchard.Environment.DefaultOrchardHost.ActivateShell(ShellContext context) +60
   Orchard.Environment.DefaultOrchardHost.<CreateAndActivate>b__4(ShellSettings settings) +74
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +66
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +216
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +77
   Orchard.Environment.DefaultOrchardHost.BuildCurrent() +186
   Orchard.Environment.DefaultOrchardHost.Orchard.Environment.IOrchardHost.Initialize() +71
   Orchard.Web.MvcApplication.HostInitialization(HttpApplication application) in d:\TeamCity\Projects\Orchard-Default\src\Orchard.Web\Global.asax.cs:48
   Orchard.WarmupStarter.<>c__DisplayClass3.<LaunchStartupThread>b__2(Object state) in d:\TeamCity\Projects\Orchard-Default\src\Orchard.Startup\Starter.cs:89

[ApplicationException: Error during application initialization]
   Orchard.WarmupStarter.Starter`1.OnBeginRequest(HttpApplication application) in d:\TeamCity\Projects\Orchard-Default\src\Orchard.Startup\Starter.cs:63
   Orchard.Web.MvcApplication.Application_BeginRequest() in d:\TeamCity\Projects\Orchard-Default\src\Orchard.Web\Global.asax.cs:29

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +192
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +108
   System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +19
   System.Web.Util.ArglessEventHandlerProxy.Callback(Object sender, EventArgs e) +56
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69



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

Developer
Oct 4, 2012 at 9:38 AM

Perhaps the hosting company installed an update on the server? I've seen this error happening after installing .NET 4.5. If you do a search on the forums, you should find a lot of posts regarding this exception.

Oct 6, 2012 at 12:02 PM

I started to get the same exception yesterday with a website running on Orchard 1.4.0.0. It obviously started to happen after some updates to the server (i'm using a shared hosting), but these morons from technical support do claim, that they did not change anything.

For testing purposes, I've deployed a clean Orchard 1.5.1 package on the server, and it works fine. So, hope to migrate my website to 1.5.1 today ;)

 

Coordinator
Oct 10, 2012 at 1:57 AM

Yes, the "morons from technical support" have obviously upgraded to .NET 4.5, which breaks 1.4. There is a patch available for .NET 4.5 that fixes the problem however, without requiring an Orchard upgrade: http://blogs.msdn.com/b/b8/archive/2012/10/09/updating-windows-8-for-general-availability.aspx

Oct 10, 2012 at 8:06 AM

Thanks Bertrand! I've already upgraded my website to 1.5.1 and it solved my problem :)

Coordinator
Oct 11, 2012 at 6:09 PM

If a previous version of Orchard doesn't work anymore with .NET 4.5, then you need to do a Windows Update, or apply those patches directly, on your server or on your hosting provider, depending on where Orchard is running:

For Win8

http://blogs.msdn.com/b/b8/archive/2012/10/09/updating-windows-8-for-general-availability.aspx

 

For x86

http://go.microsoft.com/fwlink/?LinkID=267766&clcid=0x409

 

For x64

http://go.microsoft.com/fwlink/?LinkID=267886&clcid=0x409

Dec 6, 2012 at 10:19 AM

Hi,

@blogenginenet on twitter brought this to Arvixe's attention. If you have a hosting account with Arvixe and are experiencing an issue with Orchard please e-mail QA[@]arvixe.com or contact me on here. We will make sure that your server has the proper updates for your script and provide any other assistance you may need. @blogenginenet we have also updated the ticket you provided and will continue to update that ticket. If anyone has any questions please let us know.

Regards,