SlideShare a Scribd company logo
1.Difference between Namespace and Assembly

     S.No   Namespace                          Assembly

     1      Namespace is the logical naming Scope for a particular type is defined at
            decided at design time by the run time using Assembly.
            developer.

     2      Namespace contains set of unique Assembly contains code of the form
            names.                           MSIL ( Microsoft Intermediate
                                             Language)

     3      Classes available in your program Logical units are physically grouped
            will be logically grouped together together as assembly.
            under a namespace.

     4      Namespace can include multiple An assembly can contain types
            assemblies.                    belonging to different namespaces.

     5      Namespace doesn't     have   any Assembly can be classified as private
            classification.                  assembly and public assembly. Private
                                             assembly is specific to a single
                                             application but shared/public assembly
                                             contains libraries which can be used by
                                             multiple applications.

     6      Namespaces have to be mentioned Assemblies need not be explicitly
            in Project-Properties.          specified. They are automatically
                                            described in metadata and manifest
                                            files.

     7      Namespaces can be nested. For Such nesting is not permissible in
            example:                      assemblies.
            namespace    sampleApp1     {
            namespace    SampleApp2     {
            class     sampleClass       {
            …
            }
            }
            }

     8      Namespace is the one which you     Creating an assembly on your own is
            directly specify in your code. A   not as simple as you create a
            simple example for namespace is    namespace. If you want to package the
            shown                     below:   code shown as an example for the
            namespace sampleNamespace {        namespace into an assembly, then you
            class        sampleClass       {   have to follow the steps shown below:
            public void displayMsg() {         " Generate a key file inside the same
            Console.WriteLine("In              folder where you have placed the code
            sampleClass");                     by typing the following statement in
            }                                  the         command            prompt:
            }                                  sn       -k      sampleKey.key
            }                                  " Sign your code component with this
In         this           example,   key. Assume that your code component
             sampleNamespace         is     the   is named as sampleClass.cs. Now use
             namespace you have created and       the          following         command:
             sampleClass is within the scope of   csc       sampleClass.cs         /t:library
             this namespace.                      /a.keyfile:sampleKey.key
                                                  " Place your signed assembly inside
                                                  GAC          using      AL         Utility:
                                                  AL        /i:       sampleClass.dll
                                                  " Now create a code that accesses the
                                                  code        in       your      assembly:
                                                  Using                             System;
                                                  Using                 sampleNamespace;
                                                  public        class      testClass        {
                                                  sampleClass obj = new sampleClass();
                                                  obj.displayMsg();
                                                  }
                                                  " To test if your assembly got created
                                                  and to test if the above code is
                                                  working, compile the above code using
                                                  the          following         statement:
                                                  csc testClass.cs /t:exe /r:<path of your
                                                  assembly>
                                                  " Now if you execute testClass.cs, you
                                                  should get the following output:
                                                  In sampleClass



2.Difference between System Exception and Application Exception


      S.No   System Exception                     Application Exception

      1      CLR throws system exception          Application       throws      application
                                                  exception

      2      System exceptions are generic in Application exceptions are not generic.
             nature                           Each application exception has its own
                                              customized meaning

      3      Each system exception has a          Application exceptions do not have a
             meaning. You can directly use        meaning for themselves. You have to
             them or you can derive new ones      explicitly derive from them and create
             by inheriting System.Exception       your own custom exceptions specific
                                                  to your application

      4      Example for system exceptions Example for application exceptions
             include          SqlException, include      SharePointException,
             StackOverflowException         CmsException
3.Difference between COM and .NET Component


      S.No   COM Component                          .NET Component

      1      Interface based communication          Object based communication

      2      Reference count will be used to Garbage Collector to manage memory
             manage memory

      3      Binary Standard objects                Type Standard objects

      4      Objects     are      created      by Objects are created by normal new
             coCreateInstance                     operator


      5      Object info resides in Type library    Object info resides in assembly files

      6      HRESULT will be returned               Exceptions will be returned
                                                    COM=HRESULT will be returned

4.Difference between Private Assembly and Public Assembly

      S.No   Private Assembly                       Public Assembly

      1      Private assembly can be used by        Public assembly can be used by
             only one application.                  multiple applications.

      2      Private assembly will be stored in     Public assembly is stored in GAC
             the specific application's directory   (Global Assembly Cache).
             or sub-directory.

      3      There is no other name for private     Public assembly is also termed as
             assembly.                              shared assembly.

      4      Strong name is not required for        Strong name has to be created for
             private assembly.                      public assembly.

      5      Private assembly doesn't have any Public assembly should strictly enforce
             version constraint.               version constraint.

      6      By default, all assemblies you         An example to public assembly is the
             create are examples of private         actuate report classes which can be
             assembly. Only when you                imported in the library and used by any
             associate a strong name to it and      application that prefers to implement
             store it in GAC, it becomes a          actuate reports.
             public assembly.

And, further updates on difference between questions and answers, please visit my blog @
http://onlydifferencefaqs.blogspot.in/

More Related Content

PDF
Java conditional statements
PPT
Java: GUI
PPT
JAVA OOP
PPT
Data controls ppt
PDF
Web Design & Development - Session 1
PPTX
Inheritance
PPT
GUI Programming In Java
PPTX
Introduction to Python programming
Java conditional statements
Java: GUI
JAVA OOP
Data controls ppt
Web Design & Development - Session 1
Inheritance
GUI Programming In Java
Introduction to Python programming

What's hot (20)

PPTX
Nodejs buffers
PDF
Web Development with Python and Django
PPT
Django
PPTX
.Net Assemblies
PDF
C# Delegates and Event Handling
PDF
Alter table command
PPTX
Ch 7 data binding
PPT
ADO.NET
PDF
Asp.net state management
PDF
Object oriented-systems-development-life-cycle ppt
PPTX
Object oreinted php | OOPs
PPTX
Working with xml data
KEY
Introduction to Django
PPTX
ASP.NET Page Life Cycle
PPT
Introduction to JavaScript (1).ppt
PDF
PDF
Android Telephony Manager and SMS
PDF
Lecture 5 html table
PPTX
Python Spell Checker
PDF
Type Checking
Nodejs buffers
Web Development with Python and Django
Django
.Net Assemblies
C# Delegates and Event Handling
Alter table command
Ch 7 data binding
ADO.NET
Asp.net state management
Object oriented-systems-development-life-cycle ppt
Object oreinted php | OOPs
Working with xml data
Introduction to Django
ASP.NET Page Life Cycle
Introduction to JavaScript (1).ppt
Android Telephony Manager and SMS
Lecture 5 html table
Python Spell Checker
Type Checking
Ad

Similar to Dotnet framework difference faqs- 3 (20)

PPTX
Assemblies
PDF
C# for beginners
PDF
(6) c sharp introduction_advanced_features_part_i
PDF
THE CLR AND THE .NET FRAMEWORK, C#
PPTX
Visual Basic User Interface-VI
ODP
(6) c sharp introduction_advanced_features_part_i
DOCX
C# tutorial
PDF
Intro to .NET and Core C#
PPTX
Module 12 aggregation, namespaces, and advanced scope
PPTX
.NET and C# Introduction
PPTX
1assembly in c#
PPTX
Introiduction to Assemblies and .NET platform
PDF
Dotnet interview qa
DOC
.Net assembly
PPTX
Lecture 13, 14 & 15 c# cmd let programming and scripting
PPTX
WP7 HUB_Introducción a Visual Studio
DOCX
What is Dll, Assemblies and GAC...?
PPT
Dot Net Framework
PPTX
O porque das minhas aplicações funcionarem... E o que acontece com os recurso...
PPTX
Namespaces in C#
Assemblies
C# for beginners
(6) c sharp introduction_advanced_features_part_i
THE CLR AND THE .NET FRAMEWORK, C#
Visual Basic User Interface-VI
(6) c sharp introduction_advanced_features_part_i
C# tutorial
Intro to .NET and Core C#
Module 12 aggregation, namespaces, and advanced scope
.NET and C# Introduction
1assembly in c#
Introiduction to Assemblies and .NET platform
Dotnet interview qa
.Net assembly
Lecture 13, 14 & 15 c# cmd let programming and scripting
WP7 HUB_Introducción a Visual Studio
What is Dll, Assemblies and GAC...?
Dot Net Framework
O porque das minhas aplicações funcionarem... E o que acontece com os recurso...
Namespaces in C#
Ad

More from Umar Ali (20)

PDF
Difference between wcf and asp.net web api
PDF
Difference between ActionResult() and ViewResult()
PDF
Difference between asp.net mvc 3 and asp.net mvc 4
PDF
Difference between asp.net web api and asp.net mvc
PDF
Difference between asp.net web forms and asp.net mvc
PDF
ASP.NET MVC difference between questions list 1
ODT
Link checkers 1
PDF
Affiliate Networks Sites-1
PDF
Technical Video Training Sites- 1
PDF
US News Sites- 1
PDF
How to create user friendly file hosting link sites
PDF
Weak hadiths in tamil
PDF
Bulughul Maram in tamil
PDF
Asp.net website usage and job trends
PDF
Indian news sites- 1
PDF
Photo sharing sites- 1
PDF
File hosting search engines
PDF
Ajax difference faqs compiled- 1
PDF
ADO.NET difference faqs compiled- 1
PDF
Dotnet differences compiled -1
Difference between wcf and asp.net web api
Difference between ActionResult() and ViewResult()
Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net web api and asp.net mvc
Difference between asp.net web forms and asp.net mvc
ASP.NET MVC difference between questions list 1
Link checkers 1
Affiliate Networks Sites-1
Technical Video Training Sites- 1
US News Sites- 1
How to create user friendly file hosting link sites
Weak hadiths in tamil
Bulughul Maram in tamil
Asp.net website usage and job trends
Indian news sites- 1
Photo sharing sites- 1
File hosting search engines
Ajax difference faqs compiled- 1
ADO.NET difference faqs compiled- 1
Dotnet differences compiled -1

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Electronic commerce courselecture one. Pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Encapsulation theory and applications.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Big Data Technologies - Introduction.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Teaching material agriculture food technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Review of recent advances in non-invasive hemoglobin estimation
Encapsulation_ Review paper, used for researhc scholars
Electronic commerce courselecture one. Pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Encapsulation theory and applications.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Spectral efficient network and resource selection model in 5G networks
Reach Out and Touch Someone: Haptics and Empathic Computing
Big Data Technologies - Introduction.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Chapter 3 Spatial Domain Image Processing.pdf
Empathic Computing: Creating Shared Understanding
Dropbox Q2 2025 Financial Results & Investor Presentation
The AUB Centre for AI in Media Proposal.docx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
How UI/UX Design Impacts User Retention in Mobile Apps.pdf

Dotnet framework difference faqs- 3

  • 1. 1.Difference between Namespace and Assembly S.No Namespace Assembly 1 Namespace is the logical naming Scope for a particular type is defined at decided at design time by the run time using Assembly. developer. 2 Namespace contains set of unique Assembly contains code of the form names. MSIL ( Microsoft Intermediate Language) 3 Classes available in your program Logical units are physically grouped will be logically grouped together together as assembly. under a namespace. 4 Namespace can include multiple An assembly can contain types assemblies. belonging to different namespaces. 5 Namespace doesn't have any Assembly can be classified as private classification. assembly and public assembly. Private assembly is specific to a single application but shared/public assembly contains libraries which can be used by multiple applications. 6 Namespaces have to be mentioned Assemblies need not be explicitly in Project-Properties. specified. They are automatically described in metadata and manifest files. 7 Namespaces can be nested. For Such nesting is not permissible in example: assemblies. namespace sampleApp1 { namespace SampleApp2 { class sampleClass { … } } } 8 Namespace is the one which you Creating an assembly on your own is directly specify in your code. A not as simple as you create a simple example for namespace is namespace. If you want to package the shown below: code shown as an example for the namespace sampleNamespace { namespace into an assembly, then you class sampleClass { have to follow the steps shown below: public void displayMsg() { " Generate a key file inside the same Console.WriteLine("In folder where you have placed the code sampleClass"); by typing the following statement in } the command prompt: } sn -k sampleKey.key } " Sign your code component with this
  • 2. In this example, key. Assume that your code component sampleNamespace is the is named as sampleClass.cs. Now use namespace you have created and the following command: sampleClass is within the scope of csc sampleClass.cs /t:library this namespace. /a.keyfile:sampleKey.key " Place your signed assembly inside GAC using AL Utility: AL /i: sampleClass.dll " Now create a code that accesses the code in your assembly: Using System; Using sampleNamespace; public class testClass { sampleClass obj = new sampleClass(); obj.displayMsg(); } " To test if your assembly got created and to test if the above code is working, compile the above code using the following statement: csc testClass.cs /t:exe /r:<path of your assembly> " Now if you execute testClass.cs, you should get the following output: In sampleClass 2.Difference between System Exception and Application Exception S.No System Exception Application Exception 1 CLR throws system exception Application throws application exception 2 System exceptions are generic in Application exceptions are not generic. nature Each application exception has its own customized meaning 3 Each system exception has a Application exceptions do not have a meaning. You can directly use meaning for themselves. You have to them or you can derive new ones explicitly derive from them and create by inheriting System.Exception your own custom exceptions specific to your application 4 Example for system exceptions Example for application exceptions include SqlException, include SharePointException, StackOverflowException CmsException
  • 3. 3.Difference between COM and .NET Component S.No COM Component .NET Component 1 Interface based communication Object based communication 2 Reference count will be used to Garbage Collector to manage memory manage memory 3 Binary Standard objects Type Standard objects 4 Objects are created by Objects are created by normal new coCreateInstance operator 5 Object info resides in Type library Object info resides in assembly files 6 HRESULT will be returned Exceptions will be returned COM=HRESULT will be returned 4.Difference between Private Assembly and Public Assembly S.No Private Assembly Public Assembly 1 Private assembly can be used by Public assembly can be used by only one application. multiple applications. 2 Private assembly will be stored in Public assembly is stored in GAC the specific application's directory (Global Assembly Cache). or sub-directory. 3 There is no other name for private Public assembly is also termed as assembly. shared assembly. 4 Strong name is not required for Strong name has to be created for private assembly. public assembly. 5 Private assembly doesn't have any Public assembly should strictly enforce version constraint. version constraint. 6 By default, all assemblies you An example to public assembly is the create are examples of private actuate report classes which can be assembly. Only when you imported in the library and used by any associate a strong name to it and application that prefers to implement store it in GAC, it becomes a actuate reports. public assembly. And, further updates on difference between questions and answers, please visit my blog @ http://onlydifferencefaqs.blogspot.in/