Click here to Skip to main content
15,870,165 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
What is the difference between assembly and nameSpaces in asp.net.
I asked it because it would asked me into So many interviews.
Posted

And did you try to find the answer on internet?

Here is MSDN definition for an assemblies:-

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.

A namespace, on the other hand is a collection of classes. Its more used for logical organization of your classes.
 
Share this answer
 
Comments
Prasad_Kulkarni 6-Jul-12 6:24am    
5'ed! :)
Manas Bhardwaj 6-Jul-12 6:25am    
thx :)
Volynsky Alex 8-Aug-12 17:35pm    
Right answer!
In short:
Assembly:
An assembly provides a fundamental unit of physical code grouping.
It is an Output Unit. It is a unit of Deployment & a unit of versioning. Assemblies contain MSIL code.

Namespace:
A namespace provides a fundamental unit of logical code grouping.
It is a Collection of names wherein each name is Unique.
They form the logical boundary for a Group of classes.
Namespace must be specified in Project-Properties.

Refer:
http://msdn.microsoft.com/en-us/library/ms973231.aspx[^]

And prefer google[^], it will give you huge results About 1,380,000 results (0.38 seconds) in quick time.
 
Share this answer
 
Comments
Manas Bhardwaj 6-Jul-12 6:25am    
correct +5
Prasad_Kulkarni 6-Jul-12 6:29am    
Thank you,:)
Volynsky Alex 8-Aug-12 17:32pm    
A good answer!+5!
Prasad_Kulkarni 8-Aug-12 23:58pm    
:) Thank you Alex!
Volynsky Alex 9-Aug-12 3:59am    
you are welcome
 
Share this answer
 
Comments
Volynsky Alex 8-Aug-12 18:03pm    
+5!
Namespace:
1. It is a Collection of names wherein each name is Unique.
2. They form the logical boundary for a Group of classes.
3. Namespace must be specified in Project-Properties.

Assembly:
1. It is an Output Unit. It is a unit of Deployment & a unit of versioning. Assemblies contain MSIL code.
2. Assemblies are Self-Describing. [e.g. metadata,manifest]
3. An assembly is the primary building block of a .NET Framework application. It is a collection of functionality that is built, versioned, and deployed as a single implementation unit (as one or more files). All managed types and resources are marked either as accessible only within their implementation unit, or by code outside that unit.
 
Share this answer
 
Comments
CHill60 20-Nov-13 7:47am    
I'm afraid this adds nothing to the solutions already posted a year ago
Actually, its a tricky question that which a interviewer asked.We cant able to compare both of them. We should mention the definition for it and give simple examples..

For Example:

Name Space

Everything in a a .NET framework is treated as objects. The logical collection of these related is known as NameSpace.

eg: to implement these data objects to a project, we use NameSpaces like:

System.Data;
System.Data.SqlClient;


Assembly

Assembly is a small file that create in the first successful run of a asp.net application. It contains the MSIL and Metadata. It helps in the smooth running of the application.

There are two types of assemblies: private and shared. A private assembly can be used by only a single application. A shared assembly, on the other hand, can be used by all applications located on the same server

eg. of an assembly is
System.dll
 
Share this answer
 
Comments
CHill60 29-Jul-14 11:36am    
I'm afraid this adds nothing to the answers posted 2 years ago and isn't fully accurate "It helps in the smooth running of the application" ... really???

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900