Import is not working

Asked

Viewed 148 times

5

Imports System.DirectoryServices

ERROR MESSAGE: "Warning 1 Namespace or type specified in the Imports 'System.Directory.Services' doesn’t contain any public Member or cannot be found. Make sure the namespace or the type is defined and contains at least one public Member. Make sure the Imported element name doesn’t use any aliases."

Why this is happening and how I fix it?

  • 1

    After all, it is DirectoryServices (as in the code) or Directory.Services (as in error message)?

  • 1

    is VB itself or VB.Net. Disconnection imports in VB.

  • And' without the point Directoryservices. I don’t know the difference Srr oo (I’m very new yet)

1 answer

6


You will have to add a reference to the project. The fact that you put it in the code you want to import does not indicate where the Assembly containing this namespace.

Has documentation that talks about this error.

Basic instructions for Visual Studio:

  • Open the Solution Explorer.
  • Right click on the mouse click on your project and choose Add Reference...
  • On the tab .NET look for the Assembly with the same name as namespace you want to import and click OK.

It’s not complicated to do this but if you’re struggling even to figure out the name of the language you’re using can become a very heavy burden to fix this.

  • No. It’s done. Thank you :)

  • I’m trying to use the Getlocalusers() function and I already put it in the references and it says that it is not declared

  • I already got np :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.