简体   繁体   中英

Could not load file or assembly 'Microsoft.Office.Interop.Excel'

I'm having a problem using Excel in my WinForm application. When I try it on several computers it works just fine on them, but when I try it on another computer it gives me the 'System.IO.FileLoadException: Could not load file or assembly' error.

I've added a reference in my project ('Microsoft.Office.Interop.Excel') and even set 'Copy Local' to true.

I don't know why this is happening because all computers use the same office version(Office 2007 = Version 12).

Anyone has an idea?

thanks, Udi

您可能要检查.csproj文件中的引用,以确保从bin文件夹而不是其他位置引用了DLL。

Check the Path statement on the computer that fails to load the assembly, I will bet that it is different than on the other computers.

This error is telling you that the DLL is not in the path.

For details on how Windows searches for DLLs see: Dynamic-Link Library Search Order

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