Exception enabling Orchard.Autoroute

Topics: Troubleshooting
Mar 11, 2012 at 10:44 AM

I have upgraded my orchard site to the latest 1.4 version following the document on http://docs.orchardproject.net/Documentation/Upgrading-a-site-to-a-new-version-of-Orchard

Accessing my root I get error due to content not found. No panic: I go to /Admin, log on myself and enabling the module UpgradeTo14 I get the following error:

[TypeLoadException: Inheritance security rules violated while overriding member: 'Orchard.Autoroute.Providers.SlugTokens.Describe(Orchard.Tokens.DescribeContext)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.]
   System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes) +0
   System.Reflection.RuntimeAssembly.GetExportedTypes() +38
   Orchard.Environment.Extensions.Loaders.PrecompiledExtensionLoader.LoadWorker(ExtensionDescriptor descriptor) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\Extensions\Loaders\PrecompiledExtensionLoader.cs:228
   Orchard.Environment.Extensions.Loaders.ExtensionLoaderBase.Load(ExtensionDescriptor descriptor) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\Extensions\Loaders\ExtensionLoaderBase.cs:37
   Orchard.Environment.Extensions.ExtensionManager.BuildEntry(ExtensionDescriptor descriptor) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\Extensions\ExtensionManager.cs:160
   Orchard.Environment.Extensions.<>c__DisplayClass1c.<LoadFeature>b__16(AcquireContext`1 ctx) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\Extensions\ExtensionManager.cs:110
   Orchard.Caching.Cache`2.CreateEntry(TKey k, Func`2 acquire) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Caching\Cache.cs:57
   Orchard.Caching.<>c__DisplayClass2.<Get>b__0(TKey k) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Caching\Cache.cs:19
   System.Collections.Concurrent.ConcurrentDictionary`2.AddOrUpdate(TKey key, Func`2 addValueFactory, Func`3 updateValueFactory) +125
   Orchard.Caching.Cache`2.Get(TKey key, Func`2 acquire) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Caching\Cache.cs:17
   Orchard.Caching.DefaultCacheManager.Get(TKey key, Func`2 acquire) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Caching\DefaultCacheManager.cs:33
   Orchard.Environment.Extensions.ExtensionManager.LoadFeature(FeatureDescriptor featureDescriptor) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\Extensions\ExtensionManager.cs:109

[OrchardException: Error while loading extension 'Orchard.Autoroute'.]
   Orchard.Environment.Extensions.ExtensionManager.LoadFeature(FeatureDescriptor featureDescriptor) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\Extensions\ExtensionManager.cs:123
   Orchard.Environment.Extensions.<>c__DisplayClass12.<LoadFeatures>b__11(AcquireContext`1 ctx) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\Extensions\ExtensionManager.cs:95
   Orchard.Caching.Cache`2.CreateEntry(TKey k, Func`2 acquire) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Caching\Cache.cs:57
   Orchard.Caching.<>c__DisplayClass2.<Get>b__0(TKey k) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Caching\Cache.cs:19
   System.Collections.Concurrent.ConcurrentDictionary`2.AddOrUpdate(TKey key, Func`2 addValueFactory, Func`3 updateValueFactory) +125
   Orchard.Caching.Cache`2.Get(TKey key, Func`2 acquire) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Caching\Cache.cs:17
   Orchard.Caching.DefaultCacheManager.Get(TKey key, Func`2 acquire) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Caching\DefaultCacheManager.cs:33
   Orchard.Environment.Extensions.ExtensionManager.<LoadFeatures>b__10(FeatureDescriptor descriptor) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\Extensions\ExtensionManager.cs:95
   Orchard.Caching.<>c__DisplayClass7.<RunInParallel>b__1() in c:\Users\sebros\My Projects\Orchard\src\Orchard\Caching\DefaultParallelCacheContext.cs:24
   Orchard.Caching.TaskWithAcquireContext`1.Execute() in c:\Users\sebros\My Projects\Orchard\src\Orchard\Caching\DefaultParallelCacheContext.cs:71
   Orchard.Caching.DefaultParallelCacheContext.<RunInParallel>b__2(ITask`1 task) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Caching\DefaultParallelCacheContext.cs:30
   System.Linq.Parallel.SelectQueryOperatorResults.GetElement(Int32 index) +32
   System.Linq.Parallel.ArrayMergeHelper`1.ToArrayElement(Int32 index) +22
   System.Linq.Parallel.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey) +83
   System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork() +45
   System.Linq.Parallel.SpoolingTaskBase.Work() +184
   System.Linq.Parallel.QueryTask.BaseWork(Object unused) +62
   System.Linq.Parallel.QueryTask.<.cctor>b__0(Object o) +41
   System.Threading.Tasks.Task.InnerInvoke() +67
   System.Threading.Tasks.Task.Execute() +66

[AggregateException: One or more errors occurred.]
   System.Linq.Parallel.QueryTaskGroupState.QueryEnd(Boolean userInitiatedDispose) +276
   System.Linq.Parallel.SpoolingTask.SpoolForAll(QueryTaskGroupState groupState, PartitionedStream`2 partitions, TaskScheduler taskScheduler) +130
   System.Linq.Parallel.DefaultMergeHelper`2.System.Linq.Parallel.IMergeHelper<TInputOutput>.Execute() +80
   System.Linq.Parallel.MergeExecutor`1.Execute(PartitionedStream`2 partitions, Boolean ignoreOutput, ParallelMergeOptions options, TaskScheduler taskScheduler, Boolean isOrdered, CancellationState cancellationState, Int32 queryId) +310
   System.Linq.Parallel.PartitionedStreamMerger`1.Receive(PartitionedStream`2 partitionedStream) +34
   System.Linq.Parallel.ForAllOperator`1.WrapPartitionedStream(PartitionedStream`2 inputStream, IPartitionedStreamRecipient`1 recipient, Boolean preferStriping, QuerySettings settings) +232
   System.Linq.Parallel.ChildResultsRecipient.Receive(PartitionedStream`2 inputStream) +77
   System.Linq.Parallel.ScanEnumerableQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient`1 recipient) +77
   System.Linq.Parallel.UnaryQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient`1 recipient) +390
   System.Linq.Parallel.QueryOperator`1.GetOpenedEnumerator(Nullable`1 mergeOptions, Boolean suppressOrder, Boolean forEffect, QuerySettings querySettings) +379
   System.Linq.Parallel.ForAllOperator`1.RunSynchronously() +212
   System.Linq.ParallelEnumerable.ForAll(ParallelQuery`1 source, Action`1 action) +242
   System.Linq.Parallel.ArrayMergeHelper`1.Execute() +388
   System.Linq.Parallel.QueryOperator`1.ExecuteAndGetResultsAsArray() +612
   System.Linq.ParallelEnumerable.ToArray(ParallelQuery`1 source) +71
   Orchard.Caching.DefaultParallelCacheContext.RunInParallel(IEnumerable`1 source, Func`2 selector) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Caching\DefaultParallelCacheContext.cs:27
   Orchard.Environment.Extensions.ExtensionManager.LoadFeatures(IEnumerable`1 featureDescriptors) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\Extensions\ExtensionManager.cs:93
   Orchard.Environment.ShellBuilders.CompositionStrategy.Compose(ShellSettings settings, ShellDescriptor descriptor) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\ShellBuilders\CompositionStrategy.cs:43
   Orchard.Environment.ShellBuilders.ShellContextFactory.CreateDescribedContext(ShellSettings settings, ShellDescriptor shellDescriptor) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\ShellBuilders\ShellContextFactory.cs:125
   Orchard.Environment.State.DefaultProcessingEngine.Execute(Entry entry) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\State\DefaultProcessingEngine.cs:77
   Orchard.Environment.State.DefaultProcessingEngine.ExecuteNextTask() in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\State\DefaultProcessingEngine.cs:67
   Orchard.Environment.DefaultOrchardHost.EndRequest() in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:223
   Orchard.Environment.DefaultOrchardHost.Orchard.Environment.IOrchardHost.EndRequest() in c:\Users\sebros\My Projects\Orchard\src\Orchard\Environment\DefaultOrchardHost.cs:83
   Orchard.Web.MvcApplication.HostEndRequest(HttpApplication application, IOrchardHost host) in c:\Users\sebros\My Projects\Orchard\src\Orchard.Web\Global.asax.cs:42
   Orchard.WarmupStarter.Starter`1.OnEndRequest(HttpApplication application) in C:\Users\sebros\My Projects\Orchard\src\Orchard.WarmupStarter\Starter.cs:75
   Orchard.Web.MvcApplication.Application_EndRequest() in c:\Users\sebros\My Projects\Orchard\src\Orchard.Web\Global.asax.cs:33

[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

Can anyone help me?

Coordinator
Mar 12, 2012 at 1:43 AM

It looks like you forgot a bunch of files when you upgraded. Doesn't look like you have all of 1.4 there.

Apr 24, 2012 at 3:23 PM

I had the same problem. 

I checked for all the files, and they were all there (took a while!)

What fixed it was upgrading to the latest in the 1.x branch. The commit message starting with: "Removing security attributes conflicting with dynamic compilation."

 Btw this worked fine using VS2010 dev server and IIS express. I only received the error message when I installed in on IIS7.

 

 

May 10, 2012 at 8:54 AM
Edited May 10, 2012 at 8:56 AM

I'm getting the same execption running the Orchard 1.4.1 source package in II7 (also VS2010). I'm gonna try your suggestion to get the latest branch. Thanks!