无法加载文件或程序集 - asp.net mvc应用程序

时间:2016-02-04 02:34:37

标签: c# asp.net asp.net-mvc asp.net-mvc-3 asp.net-mvc-4

使用visual studio 2010尝试使用mvc 3应用程序。该应用程序编译良好。但是,在运行时失败。

AUTO_INCREMENT

程序集加载跟踪:以下信息有助于确定无法加载程序集“InnVue.BOA.RoomControl”的原因。

ALTER TABLE [table name] AUTO_INCREMENT = 1

堆栈跟踪是:

Could not load file or assembly 'InnVue.BOA.RoomControl' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.BadImageFormatException: Could not load file or assembly 'InnVue.BOA.RoomControl' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

我已确认:

InnVue.BOA.RoomControl.dll确实是64位dll

InnVue.BOA.RoomControl.dll引用的程序集也被主项目引用。

有没有什么方法可以确切地追踪这个断裂的位置?堆栈跟踪中提供的信息不是很明显。

1 个答案:

答案 0 :(得分:0)

测试装配参考的简单测试是否已经复制本地正确添加到您的项目中尝试将发布版本部署到您的< strong>本地IIS 并尝试运行您的项目。可能你的应用程序由于缺少程序集而无法运行,在返回之前一直修复它并打包你的web应用程序以在Azure上测试它。

此外,我使用程序集绑定日志查看器,这将告诉您GAC或bin目录中不存在的缺少程序集的确切内容。

下载链接:https://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.110).aspx

希望这有帮助!