tags:

views:

285

answers:

7

I'm using a MS namespace but Visual Studio is telling me I don't have a reference to it. Is there a place you can go to and lookup namespaces?

Thanks

+4  A: 

If you mean "to find which dll I need (per-type)": MSDN?

For example, CLSID

Namespace: Microsoft.Aspnet.Snapin

Assembly: AspNetMMCExt (in AspNetMMCExt.dll)

Marc Gravell
A: 

See http://msdn.microsoft.com/en-us/library/wkze6zky(VS.80).aspx for how to add a reference

Greg B
A: 

You will also need the assembly.

For Microsoft and System namespaces the easiest way is http://msdn.microsoft.com/library or, if MSDN installed locally, its index.

Richard
A: 

If you want to know which assembly a certain class is located in you can simply check the documentation (it's noted on the class overview page of the class). Note that one namespace might very well be spread out over more than one assembly.

Fredrik Mörk
A: 

You need to first add reference to the DLL before using it in your code with the 'using' keyword.

Right click the project > add reference > in the .Net tab select the component and click ok. Then build your code.

Rashmi Pandit
+1  A: 

You can normally find the MSDN page about a specific namespace by going to http://msdn.microsoft.com/namespace. So, for example, to find out about System.Web you could go to...

http://msdn.microsoft.com/system.web

That in itself doesn't help you. You'll need to click through from there to the specific types you're using, and it'll tell you (near the top) the name of the DLL that implements the type.

Remember that a namespace can contain types that are defined in more than one DLL.

Martin
Didn't know this.. cool tip. Thanks.
Gishu
A: 

You can't find the DLL for a specified namespace in all cases because multiple types belonging to the same assembly may reside in different assemblies.

The fastest way to get there would be to google to the MSDN page for the specific type (class) you are using. Let's say XDocument.. I put `msdn xdocument class' into google. First result is the page I need. Click! Under the class name you'd see a section like this

Namespace:  System.Xml.Linq
Assembly:  System.Xml.Linq (in System.Xml.Linq.dll)

This shows you the namespace that the type belongs to (for which you may need to add a using in your code)
and the DLL you need to 'Add Reference' to.

Gishu