无法加载文件或程序集“Microsoft.Office.Interop.Excel” [英] Could not load file or assembly 'Microsoft.Office.Interop.Excel'
问题描述
当我在几台计算机上尝试时,它的工作原理很好,但是当我在另一台计算机上尝试时,它会给我System.IO.FileLoadException:无法加载文件或程序集错误。
我在项目中添加了一个引用(Microsoft.Office.Interop.Excel),甚至将Copy Local复制到true。
我不知道为什么会发生这种情况,因为所有电脑都使用相同的办公室版本(Office 2007 = Version 12)。
任何人都有想法?
谢谢,
Udi
您可能需要检查.csproj文件中的引用,以确保从bin文件夹而不是其他地方引用该DLL。
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
You might want to check the reference in the .csproj file to make sure that the DLL is being referenced from the bin folder rather than from somewhere else.
这篇关于无法加载文件或程序集“Microsoft.Office.Interop.Excel”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!