views:

435

answers:

2

I have written a program in VB.NET 2008 Express that references a .NET managed dll. I simply added a reference to the dll to the project. I then 'Imports' the dll at the beginning of the program and then can use it. Everything works fine when I am running the program in debug mode (and it uses the dll as intended), but as soon as I go to build the project I get an errors that it "Could not reslove this reference" and "Namespace of type specifier in the Imports 'ModbusTCP' doesn't contain any public member or cannot be found."

The dll is located in a different location on my hard drive to the project location, but this was referenced when I 'added reference'.

Does anyone know what I'm missing?

+1  A: 

Solved it. I just copied the dll to my bin\release folder and it now builds.

+1  A: 

Here is a better way:

  1. Go to the References tab on the Project Properties window.
  2. Click on the DLL you have added reference to.
  3. On the properties tab (window, or however you call it), set the Copy Local property of the desired dll to True.

Doing this will always copy the dll to your build directory.

Alex Essilfie