I am getting very confused between Namespaces and Assemblies. Are System.Data
and System.Web
Namespaces or Assemblies?
I have noticed these are called namespaces and at the same time they are present in GAC_32
folder. So what exactly are they?
A namespace is a logical grouping of types (mostly to avoid name collisions). An assembly can contain types in multiple namespaces ( System. DLL contains a few...), and a single namespace can be spread across assemblies (e.g. System. Threading ).
Difference Between Namespace and Assembly. Assembly will contain Namespaces, Classes, Data types it's a small unit of code for deployment. Assembly defines the name of the . dll file.It also avoids dll hell problem. Namespace is used in order to avoid conflict of user defined classes.
Which choice best describes the difference between a namespace and an assembly? Namespace contains code to form MSIL (Microsoft Intermediate Language). An assembly contains a set of unique names.
A namespace is a theoretical space in which the link between names and objects are situated: that is what is called a mapping between the names and the objects. Names are the identifiers written in a script. Objects are structures of bits lying in the memory.
System.Data
is a namespace, System.Data.DLL
(the file) is an assembly.
A namespace is a logical grouping of types (mostly to avoid name collisions). An assembly can contain types in multiple namespaces (System.DLL
contains a few...), and a single namespace can be spread across assemblies (e.g. System.Threading
).
Namespace is a logical grouping of classes belongs to same functionality. So System.Web
and System.Data
are namespaces
MSDN describe it as:
Namespaces are heavily used in C# programming in two ways. First, the .NET Framework uses namespaces to organize its many classes Secondly, declaring your own namespaces can help control the scope of class and method names in larger programming projects.
Assembly is chunk of (precompiled) code that can be executed by the .NET runtime environment. It contains one or more than one Namespaces. A .NET program consists of one or more assemblies.
System.Web.dll
and System.Data.dll
are assemblies.
MSDN describe it as:
Assemblies are the building blocks of .NET Framework applications; they form the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. An assembly provides the common language runtime with the information it needs to be aware of type implementations. To the runtime, a type does not exist outside the context of an assembly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With