Title: Find .NET libraries for namespaces in C#
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 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.
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.
|