Mike
Mike

Reputation: 41

Can't add a reference in Visual Studio

I got a problem while adding a reference in a C# project.

I want to add hLib.dll to my project, so I right click on my project name -> add reference -> browse it and add it.

But when I go and write "using hLib;" I get this error:

The type or namespace name 'hLib' could not be found (are you missing a using directive or an assembly reference?)

 ###FIXED###
Thanks for your help!

Upvotes: 0

Views: 7371

Answers (3)

Jose
Jose

Reputation: 51

I had a similar issue using Visual Studio 2017; error message (see image below) when trying to "add a reference" to a project. The issue was resolved by uninstalling a previous version of Visual Studio (2012) installed in my computer. ResourceManagerPackage error windows

Upvotes: 0

Cyral
Cyral

Reputation: 14153

Find the Object Browser by opening the solution explorer, and right clicking references > hLib.dll

You can then look into it to find the namespace, classes and other objects.

Upvotes: 1

aL3891
aL3891

Reputation: 6275

In the Solution explorer under the project, expand the References node and double click on hLib. That will open the object browser where you can see what the actual namespaces in the dll are.

From there you can see what to put in the using statement

Upvotes: 1

Related Questions