Find .NET libraries for namespaces in C#

[.NET libraries]

Some namespaces have names that nicely match their .NET libraries. For example, the System.Drawing namespace is defined in the System.Drawing library.

Unfortunately a namespace’s name doesn’t always match the name of the .NET library that defines it. For example, the System.Security namespace is defined in the System.Core library. That’s not too big a deal because System.Core is included in new applications by default so you don’t need to add a reference to it before you can use the System.Security namespace.

A tougher example is the System.Windows.Interop namespace. It’s not obvious from its name that you need to add a reference to the the PresentationCore library to use that namespace.

One way to find out which .NET libraries you need to use for a namespace is to search the internet for terms such as, “what library defines System.Windows.Interop I’m pulling my hair out in frustration.” If you’re lucky, you’ll find someone else who had the same problem.

[C# 6.0 in a Nutshell]

Happily today I came across this page that lists the .NET libraries that go with various namespaces. It’s from the book C# 6.0 in a Nutshell. The page is:

So the next time you can’t figure out which .NET libraries to use to get the features of a particular namespace, give this page a try.

Follow me on Twitter   RSS feed   Donate

About RodStephens

Rod Stephens is a software consultant and author who has written more than 30 books and 250 magazine articles covering C#, Visual Basic, Visual Basic for Applications, Delphi, and Java.
This entry was posted in .NET, miscellany and tagged , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.