我正在尝试将 Piranha CMS 集成到现有的 MVC5 Web 应用程序中。我遵循了http://piranhacms.org/docs/introduction/getting-started中的推荐路线,使用 Nuget 都是非常简单的东西。运行应用程序后,我收到一条消息,指出 AutoMapper 不存在,因此通过 Nuget 添加它。到目前为止一切都很好。再次运行它并得到这个错误:
“无法加载一种或多种请求的类型。检索 LoaderExceptions 属性以获取更多信息。”
这是堆栈:
[ReflectionTypeLoadException:无法加载一种或多种请求的类型。检索 LoaderExceptions 属性以获取更多信息。]
System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) +0
System.Reflection.RuntimeModule.GetTypes() +4
System.Reflection.Assembly.GetTypes() +70
System.ComponentModel.Composition。 Hosting.AssemblyCatalog.get_InnerCatalog() +167 System.ComponentModel.Composition.Hosting.AssemblyCatalog.GetExports(ImportDefinition 定义) +11
System.ComponentModel.Composition.Hosting.<>c__DisplayClass3.b__2(ComposablePartCatalog 目录) +17 System.Linq.d__14 1& 出口)+392.MoveNext() +177 System.ComponentModel.Composition.Hosting.CatalogExportProvider.InternalGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) +205
System.ComponentModel.Composition.Hosting.InnerCatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) +14
System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable
System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExports(ImportDefinition 定义,AtomicComposition atomicComposition,IEnumerable 1& 出口)+39 System.ComponentModel.Composition.Hosting.AggregateExportProvider.GetExportsCore(ImportDefinition 定义,AtomicComposition atomicComposition)+311 System.ComponentModel.Composition。 Hosting.ExportProvider.TryGetExportsCore(ImportDefinition 定义,AtomicComposition atomicComposition,IEnumerable 1& 出口)+23 System.ComponentModel.Composition.Hosting.CompositionContainer.GetExportsCore(ImportDefinition 定义,AtomicComposition atomicComposition)+1561& exports) +23
System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) +61
System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable1& exports) +39
System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExports(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable
System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition 定义,AtomicComposition atomicComposition,IEnumerable 1 个导入,AtomicComposition atomicComposition)+155 System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportsStateMachine(PartManager partManager,ComposablePart 部分)+439 System.ComponentModel .Composition.Hosting.ImportEngine.TrySatisfyImports(PartManager partManager,ComposablePart 部分,布尔值 shouldTrackImports)+196 System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImports(ComposablePart 部分)+107 System.ComponentModel.Composition.Hosting.<>c__DisplayClass2.b__0 () +26 System.ComponentModel.Composition.Hosting.CompositionServices.TryInvoke(Action action) +331& exports) +39
System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition) +36
System.ComponentModel.Composition.Hosting.ImportEngine.TryGetExports(ExportProvider provider, ComposablePart part, ImportDefinition definition, AtomicComposition atomicComposition) +44
System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportSubset(PartManager partManager, IEnumerable
System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.Compose(CompositionBatch 批次) +841
System.ComponentModel.Composition.Hosting.CompositionContainer.Compose(CompositionBatch 批次) +33
System.ComponentModel.Composition.AttributedModelServices.ComposeParts(CompositionContainer 容器, Object[]属性部分)+172
Piranha.Application..ctor() 在 c:\Proj\GitHub\Piranha-2.2\Piranha\Application.cs:105
Piranha.Application..cctor() 在 c:\Proj\GitHub\Piranha-2.2 \食人鱼\Application.cs:25
请特别注意堆栈的最后两行,Piranha.Application..ctor() in c:\Proj\GitHub\Piranha-2.2\Piranha\Application.cs:105 Piranha.Application..cctor() in c :\Proj\GitHub\Piranha-2.2\Piranha\Application.cs:25。它在 c:\Proj\GitHub\Piranha-2.2 中找不到 .cs 文件 ?????
只是为了确认这不是我做的愚蠢的事情,我已按照步骤将其添加到一个空的 MVC c# 项目中,结果相同。
我做错了什么还是Nuget错了?