简体   繁体   中英

Adding a dll to vb.net project in Visual Studio 2013 is not working

I'm having trouble adding dll to a vb.net project. The dll is written in c#.net, which shouldn't be a problem.

Here is what I do:

  1. In my VB project I right click on the project and choose Add / Add Reference;
  2. I browse to the dll (located in the project's folder but I've also tried other locations) and add it;
  3. I can write the Import statement without an error and use all classes / methods that are public.

The problem

The second I build my project, the dll is no longer recognised. It is still checked when I look under Add / Add Reference though

If I don't write the Import statement and just use the classes I get an error with a tool tip that creates the Import statement correctly.

I really have no idea what the problem is.

If it helps, here is my code:

Import UserEngine
....
Private Function bLogin(sUser As String, sPassword As String) As Boolean
    Dim login As UserLogin 'the class from the dll

    login = New UserLogin
    bLogin = login.login(sUser, sPassword)
End Function

Once I build the project, I get errors in the Import ... line, the Dim ... line and login = ... line saying The type "UserLogin" is not defined .

Right click on dll in references and go to properties. Set copy local to true. If that is giving you problem you can add dll to your project by add existing item.

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