首页 新闻 会员 周边 捐助

无法加载一个或多个请求的类型。有关更多信息,请检索 LoaderExceptions 属性。

0
悬赏园豆:5 [待解决问题]

“/”应用程序中的服务器错误。


 

无法加载一个或多个请求的类型。有关更多信息,请检索 LoaderExceptions 属性。

说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.Reflection.ReflectionTypeLoadException: 无法加载一个或多个请求的类型。有关更多信息,请检索 LoaderExceptions 属性。

源错误: 

执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。


堆栈跟踪: 

[ReflectionTypeLoadException: 无法加载一个或多个请求的类型。有关更多信息,请检索 LoaderExceptions 属性。]
   System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) +0
   System.Reflection.Assembly.GetTypes() +118
   System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog() +273
   System.ComponentModel.Composition.Hosting.AssemblyCatalog.GetExports(ImportDefinition definition) +13
   System.Linq.<SelectManyIterator>d__16`2.MoveNext() +253
   System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection) +462
   System.ComponentModel.Composition.Hosting.AggregateCatalog.GetExports(ImportDefinition definition) +227
   System.ComponentModel.Composition.Hosting.CatalogExportProvider.InternalGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) +241
   System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports) +31
   System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExports(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports) +20
   System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) +69
   System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports) +31
   System.ComponentModel.Composition.Hosting.AggregateExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) +393
   System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports) +31
   System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExports(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports) +20
   System.ComponentModel.Composition.Hosting.CompositionContainer.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) +241
   System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports) +31
   System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition) +40
   System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValueCore(String contractName, ImportCardinality cardinality) +103
   Dingdong.Wallet.Notify.WebApiApplication.Application_Start() in F:\Wallet\Dingdong.Wallet.Notify\Global.asax.cs:45

[HttpException (0x80004005): 无法加载一个或多个请求的类型。有关更多信息,请检索 LoaderExceptions 属性。]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +534
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +186
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +175
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +424
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +360

[HttpException (0x80004005): 无法加载一个或多个请求的类型。有关更多信息,请检索 LoaderExceptions 属性。]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +539
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +118
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +730
c#
问题补充:

 

去掉这个 才能打开  

MefContainer.GetService<IDbContext>().Preinitialize();

MefContainer.SetContainer(catalog =>
{
var context = HttpContext.Current;
if (context == null)
{
return (CallContext.HostContext ?? (CallContext.HostContext = new MefContext(catalog))) as MefContext;
}
if (context.Items.Contains("MefContext"))
{
return context.Items["MefContext"] as MefContext;
}
else
{
var result = new MefContext(catalog);
if (context != null)
{
context.Items["MefContext"] = result;
context.DisposeOnPipelineCompleted(result);
}
return result;
}
});

 

 

本地正常  上服务器 就报错

程序员编程日记的主页 程序员编程日记 | 初学一级 | 园豆:6
提问于:2018-04-18 11:51
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册