Reputation: 161
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
Upvotes: 2
Views: 9796
Reputation: 5187
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
Upvotes: 0
Reputation:
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.
Upvotes: 1