Working with Namespaces and Types
Learn about the relationship between .NET assemblies, namespaces, and types and how to effectively import namespaces to access types.
In the world of .NET development, understanding assemblies and namespaces is fundamental. Common .NET types reside within assemblies, but the relationship between assemblies and namespaces can be complex. This complexity becomes evident as we explore the associations between assemblies and namespaces, shedding light on the intricate architecture of the .NET framework.
Namespaces and types in assemblies
Many common .NET types are in the System.Runtime.dll
assembly. There is not always a one-to-one mapping between assemblies and namespaces. A single assembly can contain many namespaces, and a namespace can be defined in many assemblies. We can see the relationship between some assemblies and the namespaces that they supply types for, as shown in the following table:
Assembly | Example Namespaces | Example Types |
|
|
|
|
|
|
|
|
|
|
|
|
NuGet packages
.NET is split into packages distributed using a Microsoft-supported package management technology named ...