Orchard CMS:启用或停用的模块不起作用

时间:2018-09-29 10:18:21

标签: orchardcms

我有一个用Orchard CMS构建的网站(v.1.10.2.0);我开发了一个自定义模块并安装了该模块,该模块可以像已安装的其他模块一样正常工作。

我的问题是,从有时开始(我不确切地从什么时候开始),如果我尝试启用或禁用模块,我总是会遇到有关JetBrains.Annotations的错误(有关完整堆栈,请参见下文)。

我无法调试该站点(该站点已发布在服务器上,并且不在我的计算机上运行);谁知道我怎么知道发生了什么问题?关于如何在不调试的情况下获取一些信息的任何建议? (我对乌节很陌生。)

  

糟糕。出问题了...抱歉   发生未处理的异常,请求被终止。请刷新页面。如果错误仍然存​​在,请返回

     

发生一个或多个错误。

     

System.AggregateException:发生一个或多个错误。 ---> System.TypeLoadException:无法从程序集“ Orchard.Framework,版本= 1.10.2.0,Culture = neutral,PublicKeyToken = null”中加载类型“ JetBrains.Annotations.UsedImplicitlyAttribute”。在System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule [RuntimeModule] [ System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken,Type [] genericTypeArguments,Type [] genericMethodArguments)处的System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord,MetadataImport范围,Assembly&lastAptcaOkAssembly,RuntimeModule装饰的Token,MetaTypeImportToken) System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedMo)的attributeFilterType,布尔值mustBeInheritable,Object []属性,IList派生属性,RuntimeType&attributeType,IRuntimeMethodInfo&ctor,Boolean&ctorHasParameters,Boolean&isVarArg) dule,Int32装饰型MetadataToken,Int32 pcaCount,RuntimeType attributeFilterType,布尔值mustBeInheritable,IList派生属性,布尔值isDecoratedTargetSecurityTransparent(位于System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType类型,RuntimeType caType,布尔值继承))位于Orchard.Environment.Extensions.Type(扩展名)。类型,在Orchard.Environment.Extensions.ExtensionManager.LoadFeature(FeatureDescriptor featureDescriptor)在Orchard.Caching.Cache 2.CreateEntry(TKey k, Func 2处Orchard.Caching.Cache 2.<>c__DisplayClass3_0.<Get>b__0(TKey k) at System.Collections.Concurrent.ConcurrentDictionary 2.AddOrUpdate(TKey键) ,在Orchard.Caching.Cache 2 addValueFactory, Func 2获得了Func 2.Get(TKey key, Func 3 updateValueFactory),在Orchard.Caching.CacheManagerExtensions.Get [TKey,TResult](ICacheManager cacheManager,TKey key,布尔preventConcurrentCalls,Func {{ 1}} 1.Execute()位于System.Linq.Parallel.ArrayMergeHelper 2 acquire) at Orchard.Environment.Extensions.ExtensionManager.<LoadFeatures>b__19_0(FeatureDescriptor descriptor) at Orchard.Caching.DefaultParallelCacheContext.TaskWithAcquireContext 1.ForAllEnumerator 1.ToArrayElement(Int32 index) at System.Linq.Parallel.ForAllOperator 2.SpoolingWork()位于System.Linq.Parallel.SpoolingTaskBase.Work() .Parallel.QueryTask.BaseWork(Obje ct未使用),位于System.Threading.Tasks.Task.Execute()上-内部异常堆栈跟踪的结尾-位于System.Linq.Parallel.QueryTaskGroupState.QueryEnd(Boolean userInitiatedDispose)处于System.Linq.Parallel.DefaultMergeHelper { {1}} 1.Execute [TKey](PartitionedStream 1.MoveNext(TInput& currentElement, Int32& currentKey) at System.Linq.Parallel.ForAllSpoolingTask 1.Receive [TKey](PartitionedStream 2.System.Linq.Parallel.IMergeHelper<TInputOutput>.Execute() at System.Linq.Parallel.MergeExecutor 1.WrapPartitionedStream [TKey](PartitionedStream 2 partitions, Boolean ignoreOutput, ParallelMergeOptions options, TaskScheduler taskScheduler, Boolean isOrdered, CancellationState cancellationState, Int32 queryId) at System.Linq.Parallel.PartitionedStreamMerger 1个收件人,布尔值PreferredStriping,QuerySettings设置),位于System.Linq.Parallel.ScanQueryOperator 2 partitionedStream) at System.Linq.Parallel.ForAllOperator 1收件人的System.Linq.Parallel.UnaryQueryOperator 2 inputStream, IPartitionedStreamRecipient 2 inputStream)(位于System.Linq.Parallel.UnaryQueryOperator 2.UnaryQueryOperatorResults.ChildResultsRecipient.Receive[TKey](PartitionedStream 1收件人)在System.Linq.Parallel.ForAllOperator 1.ScanEnumerableQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient 1.Execute()处,在System.Linq.Parallel.QueryOperator 2.UnaryQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient 1处mergeOptions,布尔invalidOrder,布尔forEffect,QuerySettings querySettings)处。 System.Linq.Enumerable.d__17 1.GetOpenedEnumerator(Nullable 2.MoveNext()位于System.Linq.Enumerable.WhereEnumerableIterator 1.RunSynchronously() at System.Linq.Parallel.ArrayMergeHelper 1的QueryOperator 1.ExecuteAndGetResultsAsArray() at Orchard.Caching.DefaultParallelCacheContext.RunInParallel[T,TResult](IEnumerable 1源,Func 2 selector) at Orchard.Environment.Extensions.ExtensionManager.LoadFeatures(IEnumerable 1 featureDescriptors) ..ctor(IEnumerable 2.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator 1个来源) t Orchard.Modules.Controllers.AdminController.FeaturesPOST(FeaturesBulkAction bulkAction,IList 1.MoveNext() at System.Collections.Generic.List 1 Force)at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext,IDictionary { System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult 1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable 2.CreateEntry(TKey k,{1}} 2个参数),位于System.Web.Mvc.Async.AsyncControllerActionInvoker.b__39(IAsyncResult asyncResult,ActionInvocation innerInvokeState) Func 1 featureIds, Nullable 2。<> c__DisplayClass3_0.b__0(TKey k)at System.Collections.Concurrent.ConcurrentDictionary 2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary 2 addValueFactory,Func 2.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.Get(TKey键,Func {{1 }} 2在Orchard.Caching.DefaultParallelCacheContext.TaskWithAcquireContext 2 acquire) at Orchard.Caching.Cache 1.ToArrayElement(Int32 index)在Orchard.Environment.Extensions.ExtensionManager.b__19_0(FeatureDescriptor描述符)在System.Linq.Parallel.ForAllOperator {{ }} 1.MoveNext(TInput&currentElement,Int32&currentKey)在System.Linq.Parallel.ForAllSpoolingTask`2.Spoolin System.Linq.Parallel.SpoolingTaskBase.Work()的System.Linq.Parallel.QueryTask.BaseWork的gWork()(System.Threading.Tasks.Task.Execute()的对象未使用)<---

1 个答案:

答案 0 :(得分:1)

我几次遇到此问题。问题是扩展管理器试图加载一个程序集(可能是自定义模块),该程序集包含对JetBrains注释类的引用,这些注释类已编译到Orchard.Framework程序集中,但由于与其他包含的程序集冲突而在某些时候被删除了。具有相同名称的类。

我发现的唯一解决方案是从自定义模块中删除所有对JetBrains注释属性的使用。