【发布时间】:2017-02-04 17:58:09
【问题描述】:
如果我在本地 IIS 中访问我的 MVC 网站,没有错误,但如果我将 MVC 网站托管给外部托管服务提供商,我得到了
错误 500 - 内部服务器错误
图片如下:
注意:我的 MVC 应用程序正在使用虚拟路径提供程序,并允许 MEF 在运行时使用插件 dll,我的主站点运行正常。所有页面都可以访问,但是插件的页面不能访问。为什么会这样?
-------- 更新--------
我追踪了错误,我发现了这个:
合成产生了单个合成错误。根本原因是 下面提供。查看 CompositionException.Errors 属性 更详细的信息。
1) 指定的参数超出了有效值的范围。范围 名称:网站
导致:尝试创建实例时发生异常 'EAAccountingControllers.EAAccountingController' 类型。
导致:无法激活部件 'EAAccountingControllers.EAAccountingController'。元素: EAccountingControllers.EAAccountingController --> EAccountingControllers.EAAccountingController --> AssemblyCatalog (Assembly="EAAccounting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")
导致:无法导出 'EAAccountingControllers.EAAccountingController (ContractName="EAAccounting")' 来自部分 'EAAccountingControllers.EAAccountingController'。元素: EAccountingControllers.EAAccountingController (ContractName="EAAccounting") --> EAccountingControllers.EAAccountingController --> AssemblyCatalog (Assembly="EAAccounting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")
这是我的MEF问题,插件莫名其妙地产生了这个错误,我想知道发生了什么?
【问题讨论】:
-
查看事件日志。此外,您可能想在此处发布图片之前隐藏一些细节......!
-
IIS 也会记录一些日志。在极少数情况下,这些日志会提供确切的错误。
标签: c# asp.net asp.net-mvc asp.net-mvc-4 hosting