Diff between name space & assembly
main diff between namespace and assembly??
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Atul KumarRank #1,527 · 1K reputationPosted Jul 27, 2012, 3:46 AM EDT
You define namespace for classes using keywords
namespace MyNamespace
{
}
in an assemply and assembly is compiled into .dll file.
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Aug 1, 2012, 10:12 PM EDT
Namespace:
• To structure the project into meaningful pieces
• To distinguish classes with the same name
Assembly:
An assembly is a file that is automatically generated by the compiler upon successful compilation of every .NET application. It can be either a Dynamic Link Library or an executable file
Know more here:
http://stackoverflow.com/questions/5915033/use-of-namespaces-in-c-sharp
http://www.c-sharpcorner.com/uploadfile/ggaganesh/workingwithnamespaces11082005070923am/workingwithnamespaces.aspx
http://www.codeguru.com/columns/csharp_learning/article.php/c5845/C-FAQ-15--What-is-an-Assembly.htm
Satyapriya NayakRank #47 · 31.5K reputationPosted Aug 2, 2012, 9:55 PM EDT
Namespace is a logical naming scheme for group related types.Some class types that logically belong together they can be put into a common namespace. They prevent namespace collisions and they provide scoping. They are imported as "using" in C# or "Imports" in Visual Basic. It seems as if these directives specify a particular assembly, but they don't. A namespace can span multiple assemblies, and an assembly can define multiple namespaces. When the compiler needs the definition for a class type, it tracks through each of the different imported namespaces to the type name and searches each referenced assembly until it is found.
* An Assembly is a logical unit of code
* The constituent files can include any file types like image files, text files etc. along with DLLs or EXEs* Assembly physically exist as DLLs or EXEs
* One assembly can contain one or more files
* When you compile your source code by default the exe/dll generated is actually an assembly
* Unless your code is bundled as assembly it can not be used in any other application
* When you talk about version of a component you are actually talking about version of the assembly to which the component belongs.
* Every assembly file contains information about itself. This information is called as Assembly Manifest.
Thanks