FileNotFoundException (DLL not found)

2019-03-07 02:30发布

问题:

I'm getting that strange error on one of client's machines. It throws FileNotFoundException, but that DLL is definitely right there in the folder with Executable.. Why it can't find it? Please advise..

回答1:

Psychic debugging, since you have not included the full exception details, is that you have a 32bit versus 64bit mismatch:

  • Your Executable is AnyCPU
  • The referenced DLL (or a downstream reference) is x86
  • The machine running the executable is 64bits

Basically, you'll have to recompile your C# executable with a Platform of x86 if you have any x86 DLL dependency (usually an unmanaged DLL).



回答2:

The assembly may be missing one of its dependent assemblies.