Operation could destabalize the runtime - error

Topics: Troubleshooting
Oct 28, 2012 at 5:36 AM

I'm trying to help a friend debug their website that is running orchard.  The error in production is "Operation could destabilize the runtime" as can be seen here:   http://chietaphi.com/

I've been told that nothing has been changed in the files in the last two months but this error just started happening.

What's even stranger is that when I pull down the files and run locally from web matrix I get the following error instead:

Could not load file or assembly 'Autofac, Version=2.2.4.900, Culture=neutral, PublicKeyToken=17863af14b0044da' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Any thoughts or ideas on how to repair this site?  Thank you!

 

Developer
Oct 28, 2012 at 5:49 AM

Did someone recently update the machine with .NET 4.5? This error you mentioned happened to a lot of us after installing .NET 4.5. Please checkout this post: http://orchard.codeplex.com/discussions/392307

Oct 28, 2012 at 5:53 AM

Thanks for the heads up!  I'll contact the server to see if they can apply those updates.  It's a shared host, so hopefully this will not be a problem.

Oct 28, 2012 at 11:10 AM

The server wrote back telling me to upgrade the Orchard version to 1.5.1.  Should I look for the 1.5.1 version or is 1.6 ok to upgade to?  This site was on 1.3 before. 

I'm still getting the Autofac error locally after applying the recommended windows updates. 

Oct 29, 2012 at 10:58 AM

I'm trying to upgrade using method #2 (Upgrading An Orchard Site In-Place).  Once I make all of the changes, I'm getting the error: The resource cannot be found.

Is this a known error?  I'm attempting to upgrade to 1.6.  Any help would be greatly appreciated!

Oct 29, 2012 at 11:05 AM

in the error logs:

2012-10-29 00:03:42,815 [10] Orchard.Events.DefaultOrchardEventBus - TargetInvocationException thrown from IOrchardShellEvents.Activated by Orchard.Blogs.Routing.BlogPathConstraintUpdator
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Security.VerificationException: Operation could destabilize the runtime.
   at Orchard.ContentManagement.Handlers.ActivatingFilter`1..ctor(String[] contentTypes)
   at WebStore.Handlers.WebStoreConfigurationPartHandler..ctor(IRepository`1 repository)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
   at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ComponentActivation.<>c__DisplayClass1.<Execute>b__0()
   at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator)
   at Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Features.Collections.CollectionRegistrationSource.<>c__DisplayClass4.<>c__DisplayClass6.<RegistrationsFor>b__1(IComponentRegistration cr)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Autofac.Features.Collections.CollectionRegistrationSource.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable`1 p)
   at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Registration.ExternalRegistrySource.<>c__DisplayClass5.<RegistrationsFor>b__2(IComponentContext c, IEnumerable`1 p)
   at Autofac.Builder.RegistrationBuilder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p)
   at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Lifetime.LifetimeScope.Resolve(IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.ResolutionExtensions.TryResolve(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
   at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Service service, IEnumerable`1 parameters)
   at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context, IEnumerable`1 parameters)
   at Orchard.ContentManagement.DefaultContentManager.New(String contentType) in c:\Users\sebros\My Projects\Orchard\src\Orchard\ContentManagement\DefaultContentManager.cs:line 86
   at Orchard.ContentManagement.DefaultContentManager.Get(Int32 id, VersionOptions options) in c:\Users\sebros\My Projects\Orchard\src\Orchard\ContentManagement\DefaultContentManager.cs:line 149
   at Orchard.ContentManagement.DefaultContentQuery.<Slice>b__0(ContentItemVersionRecord x) in c:\Users\sebros\My Projects\Orchard\src\Orchard\ContentManagement\DefaultContentQuery.cs:line 141
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Orchard.ContentManagement.DefaultContentQuery.Slice(Int32 skip, Int32 count) in c:\Users\sebros\My Projects\Orchard\src\Orchard\ContentManagement\DefaultContentQuery.cs:line 139
   at Orchard.ContentManagement.DefaultContentQuery.ContentQuery`1.Orchard.ContentManagement.IContentQuery<T>.List() in c:\Users\sebros\My Projects\Orchard\src\Orchard\ContentManagement\DefaultContentQuery.cs:line 184
   at Orchard.Blogs.Services.BlogService.Get(VersionOptions versionOptions)
   at Orchard.Blogs.Services.BlogService.Get()
   at Orchard.Blogs.Routing.BlogPathConstraintUpdator.Refresh()
   at Orchard.Blogs.Routing.BlogPathConstraintUpdator.Orchard.Environment.IOrchardShellEvents.Activated()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   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 c:\Users\sebros\My Projects\Orchard\src\Orchard\Events\DefaultOrchardEventBus.cs:line 82
   at Orchard.Events.DefaultOrchardEventBus.TryInvoke(IEventHandler eventHandler, String interfaceName, String methodName, IDictionary`2 arguments, IEnumerable& returnValue) in c:\Users\sebros\My Projects\Orchard\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 c:\Users\sebros\My Projects\Orchard\src\Orchard\Events\DefaultOrchardEventBus.cs:line 51
2012-10-29 00:03:47,791 [50] Orchard.Events.DefaultOrchardEventBus - TargetInvocationException thrown from IOrchardShellEvents.Activated by Orchard.Blogs.Routing.BlogPathConstraintUpdator
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Security.VerificationException: Operation could destabilize the runtime.
   at Orchard.ContentManagement.Handlers.ActivatingFilter`1..ctor(String[] contentTypes)
   at WebStore.Handlers.WebStoreConfigurationPartHandler..ctor(IRepository`1 repository)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
   at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ComponentActivation.<>c__DisplayClass1.<Execute>b__0()
   at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator)
   at Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Features.Collections.CollectionRegistrationSource.<>c__DisplayClass4.<>c__DisplayClass6.<RegistrationsFor>b__1(IComponentRegistration cr)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Autofac.Features.Collections.CollectionRegistrationSource.<>c__DisplayClass4.<RegistrationsFor>b__0(IComponentContext c, IEnumerable`1 p)
   at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ComponentActivation.Resolve(IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Registration.ExternalRegistrySource.<>c__DisplayClass5.<RegistrationsFor>b__2(IComponentContext c, IEnumerable`1 p)
   at Autofac.Builder.RegistrationBuilder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p)
   at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ComponentActivation.Activate(IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ComponentActivation.Execute(IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ResolveOperation.Resolve(ISharingLifetimeScope activationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Lifetime.LifetimeScope.Resolve(IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.ResolutionExtensions.TryResolve(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
   at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Service service, IEnumerable`1 parameters)
   at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context, IEnumerable`1 parameters)
   at Orchard.ContentManagement.DefaultContentManager.New(String contentType) in c:\Users\sebros\My Projects\Orchard\src\Orchard\ContentManagement\DefaultContentManager.cs:line 86
   at Orchard.ContentManagement.DefaultContentManager.Get(Int32 id, VersionOptions options) in c:\Users\sebros\My Projects\Orchard\src\Orchard\ContentManagement\DefaultContentManager.cs:line 149
   at Orchard.ContentManagement.DefaultContentQuery.<Slice>b__0(ContentItemVersionRecord x) in c:\Users\sebros\My Projects\Orchard\src\Orchard\ContentManagement\DefaultContentQuery.cs:line 141
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Orchard.ContentManagement.DefaultContentQuery.Slice(Int32 skip, Int32 count) in c:\Users\sebros\My Projects\Orchard\src\Orchard\ContentManagement\DefaultContentQuery.cs:line 139
   at Orchard.ContentManagement.DefaultContentQuery.ContentQuery`1.Orchard.ContentManagement.IContentQuery<T>.List() in c:\Users\sebros\My Projects\Orchard\src\Orchard\ContentManagement\DefaultContentQuery.cs:line 184
   at Orchard.Blogs.Services.BlogService.Get(VersionOptions versionOptions)
   at Orchard.Blogs.Services.BlogService.Get()
   at Orchard.Blogs.Routing.BlogPathConstraintUpdator.Refresh()
   at Orchard.Blogs.Routing.BlogPathConstraintUpdator.Orchard.Environment.IOrchardShellEvents.Activated()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   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 c:\Users\sebros\My Projects\Orchard\src\Orchard\Events\DefaultOrchardEventBus.cs:line 82
   at Orchard.Events.DefaultOrchardEventBus.TryInvoke(IEventHandler eventHandler, String interfaceName, String methodName, IDictionary`2 arguments, IEnumerable& returnValue) in c:\Users\sebros\My Projects\Orchard\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 c:\Users\sebros\My Projects\Orchard\src\Orchard\Events\DefaultOrchardEventBus.cs:line 51

Coordinator
Oct 29, 2012 at 7:30 PM

Did you follow the upgrade instructions in the release notes? Including the bit about going to /admin and running the upgrade?

Nov 1, 2012 at 11:48 AM

I can't get to the /admin directory because of the above errors.  I think it's to the point where it may be easier (albeit very painful) to re-create the site from scratch. 

Is there any way to import the content from the database into a new instance?  I've tried following the upgrade path using both examples and cannot get this to work. 

Coordinator
Nov 3, 2012 at 7:36 AM

Copy the settings file over.