Orchard CMS:模块启用或禁用不起作用
Orchard CMS: Modules enabling or disabling not working
我有一个使用 Orchard CMS (v.1.10.2.0) 构建的网站;我开发了一个自定义模块并安装了它,它可以正常工作,就像其他已安装的模块一样。
我的问题是,从前一段时间开始(我不知道具体是从什么时候开始),如果我尝试启用或禁用某个模块,我总是会遇到关于 JetBrains.Annotations 的错误(请参阅下面的全栈)。
我无法调试站点(它发布在服务器上,而不是 运行 在我的机器上);任何人都知道我怎么能理解发生了什么问题?关于如何在不调试的情况下获取一些信息的任何建议? (我对 Orchard 很陌生)。
Oops. Something went wrong ... sorry
An unhandled exception has occurred and the request was terminated. Please refresh the page. If the error persists, go back
One or more errors occurred.
System.AggregateException: One or more errors occurred. ---> System.TypeLoadException: Could not load type 'JetBrains.Annotations.UsedImplicitlyAttribute' from assembly 'Orchard.Framework, Version=1.10.2.0, Culture=neutral, PublicKeyToken=null'. at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit) at Orchard.Environment.Extensions.ExtensionManager.GetSourceFeatureNameForType(Type type, String extensionId) at Orchard.Environment.Extensions.ExtensionManager.LoadFeature(FeatureDescriptor featureDescriptor) at Orchard.Caching.Cache2.CreateEntry(TKey k, Func
2 acquire) at Orchard.Caching.Cache2.<>c__DisplayClass3_0.<Get>b__0(TKey k) at System.Collections.Concurrent.ConcurrentDictionary
2.AddOrUpdate(TKey key, Func2 addValueFactory, Func
3 updateValueFactory) at Orchard.Caching.Cache2.Get(TKey key, Func
2 acquire) at Orchard.Caching.CacheManagerExtensions.Get[TKey,TResult](ICacheManager cacheManager, TKey key, Boolean preventConcurrentCalls, Func2 acquire) at Orchard.Environment.Extensions.ExtensionManager.<LoadFeatures>b__19_0(FeatureDescriptor descriptor) at Orchard.Caching.DefaultParallelCacheContext.TaskWithAcquireContext
1.Execute() at System.Linq.Parallel.ArrayMergeHelper1.ToArrayElement(Int32 index) at System.Linq.Parallel.ForAllOperator
1.ForAllEnumerator1.MoveNext(TInput& currentElement, Int32& currentKey) at System.Linq.Parallel.ForAllSpoolingTask
2.SpoolingWork() at System.Linq.Parallel.SpoolingTaskBase.Work() at System.Linq.Parallel.QueryTask.BaseWork(Object unused) at System.Threading.Tasks.Task.Execute() --- End of inner exception stack trace --- at System.Linq.Parallel.QueryTaskGroupState.QueryEnd(Boolean userInitiatedDispose) at System.Linq.Parallel.DefaultMergeHelper2.System.Linq.Parallel.IMergeHelper<TInputOutput>.Execute() at System.Linq.Parallel.MergeExecutor
1.Execute[TKey](PartitionedStream2 partitions, Boolean ignoreOutput, ParallelMergeOptions options, TaskScheduler taskScheduler, Boolean isOrdered, CancellationState cancellationState, Int32 queryId) at System.Linq.Parallel.PartitionedStreamMerger
1.Receive[TKey](PartitionedStream2 partitionedStream) at System.Linq.Parallel.ForAllOperator
1.WrapPartitionedStream[TKey](PartitionedStream2 inputStream, IPartitionedStreamRecipient
1 recipient, Boolean preferStriping, QuerySettings settings) at System.Linq.Parallel.UnaryQueryOperator2.UnaryQueryOperatorResults.ChildResultsRecipient.Receive[TKey](PartitionedStream
2 inputStream) at System.Linq.Parallel.ScanQueryOperator1.ScanEnumerableQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient
1 recipient) at System.Linq.Parallel.UnaryQueryOperator2.UnaryQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient
1 recipient) at System.Linq.Parallel.QueryOperator1.GetOpenedEnumerator(Nullable
1 mergeOptions, Boolean suppressOrder, Boolean forEffect, QuerySettings querySettings) at System.Linq.Parallel.ForAllOperator1.RunSynchronously() at System.Linq.Parallel.ArrayMergeHelper
1.Execute() at System.Linq.Parallel.QueryOperator1.ExecuteAndGetResultsAsArray() at Orchard.Caching.DefaultParallelCacheContext.RunInParallel[T,TResult](IEnumerable
1 source, Func2 selector) at Orchard.Environment.Extensions.ExtensionManager.LoadFeatures(IEnumerable
1 featureDescriptors) at System.Linq.Enumerable.d__172.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator
2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at System.Collections.Generic.List
1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable
1 source) at Orchard.Modules.Controllers.AdminController.FeaturesPOST(FeaturesBulkAction bulkAction, IList1 featureIds, Nullable
1 force) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary
2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult2.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() ---> (Inner Exception #0) System.TypeLoadException: Could not load type 'JetBrains.Annotations.UsedImplicitlyAttribute' from assembly 'Orchard.Framework, Version=1.10.2.0, Culture=neutral, PublicKeyToken=null'. at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit) at Orchard.Environment.Extensions.ExtensionManager.GetSourceFeatureNameForType(Type type, String extensionId) at Orchard.Environment.Extensions.ExtensionManager.LoadFeature(FeatureDescriptor featureDescriptor) at Orchard.Caching.Cache
2.CreateEntry(TKey k, Func2 acquire) at Orchard.Caching.Cache
2.<>c__DisplayClass3_0.b__0(TKey k) at System.Collections.Concurrent.ConcurrentDictionary2.AddOrUpdate(TKey key, Func
2 addValueFactory, Func3 updateValueFactory) at Orchard.Caching.Cache
2.Get(TKey key, Func2 acquire) at Orchard.Caching.CacheManagerExtensions.Get[TKey,TResult](ICacheManager cacheManager, TKey key, Boolean preventConcurrentCalls, Func
2 acquire) at Orchard.Environment.Extensions.ExtensionManager.b__19_0(FeatureDescriptor descriptor) at Orchard.Caching.DefaultParallelCacheContext.TaskWithAcquireContext1.Execute() at System.Linq.Parallel.ArrayMergeHelper
1.ToArrayElement(Int32 index) at System.Linq.Parallel.ForAllOperator1.ForAllEnumerator
1.MoveNext(TInput& currentElement, Int32& currentKey) at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork() at System.Linq.Parallel.SpoolingTaskBase.Work() at System.Linq.Parallel.QueryTask.BaseWork(Object unused) at System.Threading.Tasks.Task.Execute()<---
这个问题我遇到过几次。问题是扩展管理器试图加载一个程序集(可能是自定义模块),其中包含对 JetBrains 注释 类 的引用,这些注释被编译到 Orchard.Framework
程序集中,但由于与包含 类 同名的其他程序集。
我找到的唯一解决方案是从自定义模块中删除 JetBrains 注释属性的所有用法。
我有一个使用 Orchard CMS (v.1.10.2.0) 构建的网站;我开发了一个自定义模块并安装了它,它可以正常工作,就像其他已安装的模块一样。
我的问题是,从前一段时间开始(我不知道具体是从什么时候开始),如果我尝试启用或禁用某个模块,我总是会遇到关于 JetBrains.Annotations 的错误(请参阅下面的全栈)。
我无法调试站点(它发布在服务器上,而不是 运行 在我的机器上);任何人都知道我怎么能理解发生了什么问题?关于如何在不调试的情况下获取一些信息的任何建议? (我对 Orchard 很陌生)。
Oops. Something went wrong ... sorry An unhandled exception has occurred and the request was terminated. Please refresh the page. If the error persists, go back
One or more errors occurred.
System.AggregateException: One or more errors occurred. ---> System.TypeLoadException: Could not load type 'JetBrains.Annotations.UsedImplicitlyAttribute' from assembly 'Orchard.Framework, Version=1.10.2.0, Culture=neutral, PublicKeyToken=null'. at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit) at Orchard.Environment.Extensions.ExtensionManager.GetSourceFeatureNameForType(Type type, String extensionId) at Orchard.Environment.Extensions.ExtensionManager.LoadFeature(FeatureDescriptor featureDescriptor) at Orchard.Caching.Cache
2.CreateEntry(TKey k, Func
2 acquire) at Orchard.Caching.Cache2.<>c__DisplayClass3_0.<Get>b__0(TKey k) at System.Collections.Concurrent.ConcurrentDictionary
2.AddOrUpdate(TKey key, Func2 addValueFactory, Func
3 updateValueFactory) at Orchard.Caching.Cache2.Get(TKey key, Func
2 acquire) at Orchard.Caching.CacheManagerExtensions.Get[TKey,TResult](ICacheManager cacheManager, TKey key, Boolean preventConcurrentCalls, Func2 acquire) at Orchard.Environment.Extensions.ExtensionManager.<LoadFeatures>b__19_0(FeatureDescriptor descriptor) at Orchard.Caching.DefaultParallelCacheContext.TaskWithAcquireContext
1.Execute() at System.Linq.Parallel.ArrayMergeHelper1.ToArrayElement(Int32 index) at System.Linq.Parallel.ForAllOperator
1.ForAllEnumerator1.MoveNext(TInput& currentElement, Int32& currentKey) at System.Linq.Parallel.ForAllSpoolingTask
2.SpoolingWork() at System.Linq.Parallel.SpoolingTaskBase.Work() at System.Linq.Parallel.QueryTask.BaseWork(Object unused) at System.Threading.Tasks.Task.Execute() --- End of inner exception stack trace --- at System.Linq.Parallel.QueryTaskGroupState.QueryEnd(Boolean userInitiatedDispose) at System.Linq.Parallel.DefaultMergeHelper2.System.Linq.Parallel.IMergeHelper<TInputOutput>.Execute() at System.Linq.Parallel.MergeExecutor
1.Execute[TKey](PartitionedStream2 partitions, Boolean ignoreOutput, ParallelMergeOptions options, TaskScheduler taskScheduler, Boolean isOrdered, CancellationState cancellationState, Int32 queryId) at System.Linq.Parallel.PartitionedStreamMerger
1.Receive[TKey](PartitionedStream2 partitionedStream) at System.Linq.Parallel.ForAllOperator
1.WrapPartitionedStream[TKey](PartitionedStream2 inputStream, IPartitionedStreamRecipient
1 recipient, Boolean preferStriping, QuerySettings settings) at System.Linq.Parallel.UnaryQueryOperator2.UnaryQueryOperatorResults.ChildResultsRecipient.Receive[TKey](PartitionedStream
2 inputStream) at System.Linq.Parallel.ScanQueryOperator1.ScanEnumerableQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient
1 recipient) at System.Linq.Parallel.UnaryQueryOperator2.UnaryQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient
1 recipient) at System.Linq.Parallel.QueryOperator1.GetOpenedEnumerator(Nullable
1 mergeOptions, Boolean suppressOrder, Boolean forEffect, QuerySettings querySettings) at System.Linq.Parallel.ForAllOperator1.RunSynchronously() at System.Linq.Parallel.ArrayMergeHelper
1.Execute() at System.Linq.Parallel.QueryOperator1.ExecuteAndGetResultsAsArray() at Orchard.Caching.DefaultParallelCacheContext.RunInParallel[T,TResult](IEnumerable
1 source, Func2 selector) at Orchard.Environment.Extensions.ExtensionManager.LoadFeatures(IEnumerable
1 featureDescriptors) at System.Linq.Enumerable.d__172.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator
2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at System.Collections.Generic.List
1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable
1 source) at Orchard.Modules.Controllers.AdminController.FeaturesPOST(FeaturesBulkAction bulkAction, IList1 featureIds, Nullable
1 force) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary
2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult2.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() ---> (Inner Exception #0) System.TypeLoadException: Could not load type 'JetBrains.Annotations.UsedImplicitlyAttribute' from assembly 'Orchard.Framework, Version=1.10.2.0, Culture=neutral, PublicKeyToken=null'. at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit) at Orchard.Environment.Extensions.ExtensionManager.GetSourceFeatureNameForType(Type type, String extensionId) at Orchard.Environment.Extensions.ExtensionManager.LoadFeature(FeatureDescriptor featureDescriptor) at Orchard.Caching.Cache
2.CreateEntry(TKey k, Func2 acquire) at Orchard.Caching.Cache
2.<>c__DisplayClass3_0.b__0(TKey k) at System.Collections.Concurrent.ConcurrentDictionary2.AddOrUpdate(TKey key, Func
2 addValueFactory, Func3 updateValueFactory) at Orchard.Caching.Cache
2.Get(TKey key, Func2 acquire) at Orchard.Caching.CacheManagerExtensions.Get[TKey,TResult](ICacheManager cacheManager, TKey key, Boolean preventConcurrentCalls, Func
2 acquire) at Orchard.Environment.Extensions.ExtensionManager.b__19_0(FeatureDescriptor descriptor) at Orchard.Caching.DefaultParallelCacheContext.TaskWithAcquireContext1.Execute() at System.Linq.Parallel.ArrayMergeHelper
1.ToArrayElement(Int32 index) at System.Linq.Parallel.ForAllOperator1.ForAllEnumerator
1.MoveNext(TInput& currentElement, Int32& currentKey) at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork() at System.Linq.Parallel.SpoolingTaskBase.Work() at System.Linq.Parallel.QueryTask.BaseWork(Object unused) at System.Threading.Tasks.Task.Execute()<---
这个问题我遇到过几次。问题是扩展管理器试图加载一个程序集(可能是自定义模块),其中包含对 JetBrains 注释 类 的引用,这些注释被编译到 Orchard.Framework
程序集中,但由于与包含 类 同名的其他程序集。
我找到的唯一解决方案是从自定义模块中删除 JetBrains 注释属性的所有用法。