Difference between NameSpace and Assembly

Namespace and Assembly ?

A .Net Namespace provides the fundamental unit of logical code grouping while an assembly provides a fundamental unit of physical code grouping.


Namespaces is a logical group of related classes that can be used by any other language targeting the Microsoft .Net framework . It is more used for logical organization of your classes. Namespaces are a way of grouping type names and reducing the chance of name collisions.

Hierarchy and Fully-Qualified Names

The fully qualified name of a class is constructed by concatenating the names of all the namespaces that contain the type. For e.g. the fully qualified name of the TextBox class is System.Windows.Forms.TextBox . That means TextBox class is contained in the Forms namespace that is contained in the Windows namespace that is contained in the root System namespace.

Textbox namespace Hierarchy



An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. It is an Output Unit, that is .exe or .dll file. It is a unit of Deployment and a unit of versioning and also it contain MSIL (Microsoft Intermediate Language) code. Assemblies are self describing, it contains all the metadata about the modules, types, and other elements in the form of a manifest.

Assemblies are of two types: Private and Shared Assemblies.

Private Assemblies

Private assembly is intended only for one application. The files of that assembly must be placed in the same folder of the application.

Shared Assemblies

Shared assembly is to be made into a Shared Assembly, then the naming conventions are very strict since it has to be unique across the entire system