orchardcms - Orchard CMS:启用或禁用的模块不起作用
问题描述
我有一个使用 Orchard CMS (v.1.10.2.0) 构建的网站;我开发了一个自定义模块并安装了它,它正在工作,就像已经安装的其他模块一样。
我的问题是,从有时开始(我不确切知道从什么时候开始),如果我尝试启用或禁用一个模块,我总是遇到关于 JetBrains.Annotations 的错误(完整堆栈见下文)。
我无法调试站点(它发布在服务器上,它没有在我的机器上运行);任何人都知道我怎么能理解发生了什么问题?关于如何在不调试的情况下获得一些信息的任何建议?(我对果园很陌生)。
哎呀。出了点问题……抱歉 发生了未处理的异常,请求被终止。请刷新页面。如果错误仍然存在,请返回
发生一个或多个错误。
System.AggregateException:发生一个或多个错误。---> System.TypeLoadException:无法从程序集“Orchard.Framework,Version=1.10.2.0,Culture=neutral,PublicKeyToken=null”加载类型“JetBrains.Annotations.UsedImplicitlyAttribute”。在 System.ModuleHandle.ResolveType(RuntimeModule 模块,Int32 typeToken,IntPtr* typeInstArgs,Int32 typeInstCount,IntPtr* methodInstArgs,Int32 methodInstCount,ObjectHandleOnStack 类型)在 System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule 模块,Int32 typeToken,RuntimeTypeHandle[] typeInstantiationHandle ] methodInstantiationContext) 在 System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) 在 System.Reflection.CustomAttribute。
2.CreateEntry(TKey k, Func
2 获取)在 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) 在 Orchard.Caching.Cache2.Get(TKey key, Func
2 获取)在 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() 在 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() 在 System.Linq.Parallel.SpoolingTaskBase.Work() 在 System.Linq.Parallel.QueryTask.BaseWork(对象未使用)在 System.Threading.Tasks.Task.Execute() --- 内部异常堆栈跟踪结束 --- 在 System.Linq.Parallel.QueryTaskGroupState.QueryEnd(Boolean userInitiatedDispose) 在 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 收件人,布尔值 preferStriping,QuerySettings 设置)在 System.Linq.Parallel.UnaryQueryOperator2.UnaryQueryOperatorResults.ChildResultsRecipient.Receive[TKey](PartitionedStream
2 inputStream)在 System.Linq.Parallel.ScanQueryOperator1.ScanEnumerableQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient
1 收件人)在 System.Linq.Parallel.UnaryQueryOperator2.UnaryQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient
1 收件人)在 System.Linq.Parallel.QueryOperator1.GetOpenedEnumerator(Nullable
1 的 mergeOptions、Boolean suppressOrder、Boolean forEffect、QuerySettings querySettings) 在 System.Linq.Parallel.ForAllOperator1.RunSynchronously() at System.Linq.Parallel.ArrayMergeHelper
1.Execute() 在 System.Linq.Parallel.QueryOperator1.ExecuteAndGetResultsAsArray() at Orchard.Caching.DefaultParallelCacheContext.RunInParallel[T,TResult](IEnumerable
1 源、Func2 selector) at Orchard.Environment.Extensions.ExtensionManager.LoadFeatures(IEnumerable
1 featureDescriptors) 在 System .Linq.Enumerable.d__172.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator
2.MoveNext() 在 System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at System.Collections.Generic.List
1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable
1 来源) 在 Orchard.Modules.Controllers.AdminController.FeaturesPOST(FeaturesBulkAction bulkAction, IList1 featureIds, Nullable
1 force) 在 lambda_method(Closure , ControllerBase , Object[] ) 在 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary
2 参数)在 System.Web.Mvc.Async.AsyncControllerActionInvoker.b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) 在 System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult 2.CreateEntry2.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
(TKey k, Func2 acquire) at Orchard.Caching.Cache
2.<>c__DisplayClass3_0.b__0(TKey k)在 System.Collections.Concurrent.ConcurrentDictionary2.AddOrUpdate(TKey key, Func
2 addValueFactory,Func 2.Get3 updateValueFactory) at Orchard.Caching.Cache
(TKey 键,Func2 acquire) at Orchard.Caching.CacheManagerExtensions.Get[TKey,TResult](ICacheManager cacheManager, TKey key, Boolean preventConcurrentCalls, Func
2 获取)在 Orchard.Environment.Extensions.ExtensionManager.b__19_0(FeatureDescriptor 描述符)在 Orchard.Caching.DefaultParallelCacheContext.TaskWithAcquireContext1.Execute() at System.Linq.Parallel.ArrayMergeHelper
1.ToArrayElement(Int32 索引)在 System.Linq.Parallel.ForAllOperator1.ForAllEnumerator
1.MoveNext(TInput& currentElement,Int32& currentKey)在 System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork() 在 System.Linq.Parallel.SpoolingTaskBase.Work() 在 System.Linq.Parallel.QueryTask.BaseWork(对象未使用) 在 System.Threading.Tasks.Task.Execute ()<---
解决方案
我遇到过几次这个问题。问题是扩展管理器尝试加载包含对 JetBrains 注释类的引用的程序集(可能是自定义模块),这些注释类已编译到Orchard.Framework
程序集中,但由于与包含同名类的其他程序集冲突而在某些时候被删除.
我找到的唯一解决方案是从自定义模块中删除 JetBrains 注释属性的所有用法。
推荐阅读
- typescript - How to generate TypeScript files by combining TypeScript declaration files and corresponding JavaScript files
- r - terra 包在尝试运行并行操作时返回错误
- swift - iOS Danielgindi 图表中的 EXC_BAD_ACCESS (code=1, address=0x) ChartDataSet 条目
- c++ - 删除指针后的C++
- git - 推送到 DAGsHub 时出现 401
- elasticsearch - 如何使用 helm 将“冷数据节点”添加到 elasticsearch 集群?
- java - 是两个字谜吗?
- android - 如何在Android中分屏Camera 2
- html - 如何使这个嵌入式谷歌工作表代码响应?
- java - MethodHandle 强制转换返回类型