简体   繁体   中英

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

i have one web application i have hosted it on IIS 7. When i browse the site its giving me following error:

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.

i tried several things but nothing working out.please suggest me something relevant.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM