Simple one: DLL reference not working when I move App

HELJ

Newcomer
Joined
May 29, 2003
Messages
8
Hello,

Im normally an ASP.NET person but had to create an EXE in VB.net for a particular task. This EXE references a DLL that is located at C:\Components\. I've added the Imports line to my Module as well.

When I compile it and run the EXE from the project bin folder, it works fine. When I try to move the EXE to some other location on my machine (like C:\EXAMPLE\MyEXE.exe) it crashes and fails saying that it cant find the referenced DLL.

Since I am defining the absolute path to the DLL, why would it work in one location, and not on another (on the same machine)?

Thanks very much,

Helj
 
You're not defining an absolute path. When VS builds your project, it is copying the DLL to reside in the same folder as the EXE file.

.NET executables look for assemblies in the same directory as themselves, then any configured subdirectories, then in the GAC (global assembly cache).
 
Back
Top