Click here to Skip to main content
12,402,189 members (65,843 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# C#4.0
What is the difference between assembly and nameSpaces in asp.net.
I asked it because it would asked me into So many interviews.
Posted 6-Jul-12 0:13am
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
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!
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
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
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

  Permalink  
Comments
Volynsky Alex 8-Aug-12 18:03pm
   
+5!
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

Hi Rizwan,

Please have a look at the below link for the differences between Assembly and Namespaces in ASP.NET,

http://onlydifferencefaqs.blogspot.in/2012/08/dotnet-framework-difference-faqs-3.html[^]
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 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.
  Permalink  
Comments
CHill60 20-Nov-13 7:47am
   
I'm afraid this adds nothing to the solutions already posted a year ago
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 6

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
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 29 Jul 2014
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100