Jayne Brown
Jayne Brown

Reputation:

c# Where can I lookup Microsoft Namespace names?

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

Upvotes: 2

Views: 1018

Answers (7)

Gishu
Gishu

Reputation: 136633

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.

Upvotes: 0

Martin
Martin

Reputation: 5452

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.

Upvotes: 1

Rashmi Pandit
Rashmi Pandit

Reputation: 23818

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.

Upvotes: 0

Fredrik Mörk
Fredrik Mörk

Reputation: 158309

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.

Upvotes: 0

Richard
Richard

Reputation: 109015

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.

Upvotes: 0

Greg B
Greg B

Reputation: 14888

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

Upvotes: 0

Marc Gravell
Marc Gravell

Reputation: 1062865

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

For example, CLSID

Namespace: Microsoft.Aspnet.Snapin

Assembly: AspNetMMCExt (in AspNetMMCExt.dll)

Upvotes: 4

Related Questions