简体   繁体   中英

Problems building a VB.NET 2008 express project referencing a dll

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?

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM