0

我有一个 Web 应用程序,我将它托管在 IIS 7 上。当我浏览该站点时,它给了我以下错误:

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

**Description:** An unhanded 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 'Interop.MODI' or one of its dependencies. An attempt was made to load a program with an incorrect format.

我尝试了几件事,但没有任何结果。请给我一些相关的建议。

4

1 回答 1

1

Most likely 32 vs. 64 bit mismatch. You are likely trying to load 32 bit Microsoft Office native code into 64bit IIS AppPool. To hack it working - try to change AppPool to 32 bit.

See related Using Interop.MODI Throws 0x80040154 Exception

Note: using Microsoft Office application/tools on the server is bad idea. Not supported/unlikely to work - enjoy issues at your own risk.

于 2013-04-19T05:33:00.520 回答