FNR
FNR

Reputation: 499

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.

Upvotes: 0

Views: 2421

Answers (1)

Claudius
Claudius

Reputation: 1911

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.

Upvotes: 1

Related Questions