'System.IO.FileNotFoundException'

InertiaM

Well-known member
Joined
Nov 3, 2007
Messages
663
Location
Kent, UK
Programming Experience
10+
I am getting an error 'System.IO.FileNotFoundException' when running my program. The DLL is referenced properly and is the correct version.

I assume this is because the referenced DLL is not in the same folder as the Executable. If I put the DLL into the same directory (eg the BIN directory), everything works fine.

My issue is that I reuse the DLL in many programs, so do not want copies in multiple folders. Any ideas? Can I not just have one copy and tell my EXE where to look for the DLL on the deployment PC?
 
Look up information about Global Assembly Cache (GAC).
 
Thank you JohnH, worked perfectly :)

For anyone else who tries this :-

If you get a message "Failure adding assembly to the cache - unknown error", Gacutil is version specific and you need to use the correct version. I found three different versions on my PC, one right and two wrong.
 
Back
Top