Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • *Gurus*
Posted

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).

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...