VisualBuilder
  Home > Dotnet > Tutorials > Assembly - .NET Tutorial
Tell a friend
Link to us
Total Members
      Members: 84606
     
Sitemap Forum Chat
Home
.NET Tutorial Home
1 . Overview of .Net Framework
2 . .Net Components:
3 . CLR (Common Language Runtime)
4 . Steps to Run a program in CLR
5 . Assembly
6 . GAC (Global Assembly CACHE)
7 . Strong Name in .Net Assembly
8 . ILDASM: Intermediate Language Disassembler in .Net
9 . Custom Attributes in .Net
10 . Application Domain in .Net
11 . Code Access Security in .Net
12 . Type System in .Net -1
13 . Type System in .Net -2
14 . Reflection: Inspection of a Type\'s Metadata
15 . Introduction to Generics
16 . Generic Classes and Methods
17 . Generic Methods in .Net 2.0
18 . Overview of Inheritance in Generics classes
19 . Connection pooling in .Net Applications
20 . Deployment in .Net
 
Dotnet Group Home
Dotnet Discussion (9)
Dotnet Members (2825)
Dotnet Resources
Dotnet Source Code (0)
Dotnet Articles (0)
Dotnet Blogs
Dotnet Jobs
Dotnet Components (2)
Dotnet Books
Dotnet Websites (43)
Dotnet News (186)
Dotnet Q & A (3)
- Dotnet Ask Question
- Dotnet Questions
- Dotnet Unanswered Questions
 
GROUPS
.NET
ASP.NET
.NET
C#
ASP
Visual Basic
Java
Java
JSP
EJB
Other
Delphi
C++
Ajax
UML
JavaScript
PHP
Web Design
Web Hosting
SQL Server
Oracle
Project Management
More Groups

 
LEARNING CENTER
TUTORIALS
.NET
.NET Tutorial
ASP Tutorial
ASP.NET Database Tutorial
ASP.NET Development Tips
ASP.Net Security,Internationalisation And Deployment
ASP.NET Server Controls Tips
ASP.NET Tutorial
C Sharp Tutorial
Web Development
Flex Tutorial
HTML Tutorial
Learn AJAX Tutorial
PHP Tutorial
Software Development
Database Tutorial
SQL Tutorial
UML Tutorial
Java
Ant Tutorial
EJB 3 Tutorial
Hibernate Tutorial
Java Tutorial
Java Web Component Tutorial
Java XML Tutorial
JDBC Tutorial
JDK1.5 Tutorial
JSF Tutorial
JSP And J2EE Design Tutorial
JSP Tutorial
Spring Tutorial
Struts Tutorial

RESOURCES
Q & A (432 )
Source Code (3217 )
Articles (11 )
Components (1589 )
News (880 )
Websites (1207 )

SUBMISSIONS
Submit Article
Submit Website
Submit News
Submit Source Code
Submit Component

COMMUNITY
Members Directory
Discussion Forum
Chat

SITE
About Us
Sitemap
Search
Contact Us
Link To Us
Feedback
Tell a Friend
Partners
Advertise


Dotnet Tutorial
 Assembly
  << Prev: Steps to Run a program in CLR Next: GAC (Global Assembly CACHE) >>

Assembly is smallest unit of deployment. An assembly consists of one or more files (dlls, exe's, html files etc) and represents a group of resources, type definitions and implementation of those types. An assembly may also contain references to other assemblies. The assembly manifest contains the version information. An assembly is the smallest unit that you use to define the version of an application. The version of an assembly determines the version of the types and the other resources that it contains.


 


The .Net framework allows the execution of multiple versions of the same assembly on the same machine. The side-by-side execution of assemblies overcomes the problem known as “DLL Hell”, which is one of the major problems associated with COM applications.


 


Assemblies are the smallest units to which the .Net framework grants permissions. They provide security boundaries within the .Net framework. When the assembly is loaded into the runtime, the assembly sends the request to the runtime to grant the permission. The permission granted depends on the policy files that are checked by the security engine of the runtime.


 


Assemblies are a fundamental part of programming with the .net framework. An assembly performs the following functions:


 


Functions or Features:



  • It contains the code that a CLR executes.

  • MSIL code in a portable executable file will not be executed if it doesn't contain the associated assembly manifest.

  • Each assembly can have only one entry point( that is DllMain, WinMain, Main )

  • It forms a security boundary. An assembly is a unit at which permissions are requested and granted.

  • Type Boundary: Every type identity includes the name of the assembly in which its resides.

  • Reference Scope Boundary: The assembly manifest contains assembly metadata that is used for resolving types and satisfying resources requests.

  • Version Boundary: The assembly is the smallest versionable unit in the CLR, all types and resources in the same assembly are versioned as a unit.

  • It forms a deployment unit: When an application starts, only the assemblies that the application initially calls must be present. Other assemblies, such as localization resources or assemblies containing utility classes can be retrieved on demand.

  • Side-by-Side Execution is supported by assemblies.


Understanding Namespaces:


 


The .Net Framework class library consists of reusable classes, which are organized in hierarchical namespace. A namespace contains logically – and functionally- related classes and divides an assembly into a logical grouping of types. e.g. System.Data namespace contains all the classes that you require to build database applications, and System.IO namespace contains all the classes that you require to perform input and output operations within a program. Multiple assemblies can use the same namespace.


 


Assemblies can be staic or dynamic. The following is the defination for static and dynamic assemblies.


 


Static assemblies : Static assemblies can include .Net framework types (interface and classes) as well as resources for the assembly. Static assemblies are stored on disk in PE file.


 


Dynamic assemblies : The dynamic assemblies can be created using the .Net framework and they are not saved to disk before execution. You can save dynamic assemblies to disk after they have executed.


 


Assembly Contents


 


In general, a static assembly consists of four elements:



  • Assembly Manifest

  • Type metadata

  • MSIL code that implements the type.

  • Set of resources.


Note:-There are several ways to group these elements in assembly. Two ways to group these within a single file or with different set of files.


 


The elements of an assembly can be contained in several files. These files can be modules of compiled code (.netmodule), resources.


 


Assembly Manifest:


 


Every assembly, whether static or dynamic, contains a collection of data that describes how the elements in the assembly relate to each other. Assembly Manifest contains the following information:



  • Assembly Name: A text string specifying the assembly name.

  • Version Number: A major, minor, revision and build number. The CLR uses these numbers to enforce version policy.

  • Culture: Information on the culture or language the assembly supports. The information should be used only to designate an assembly as a satellite

  • assembly containing culture- or language-specific information.

  • Strong Name Information: The public key from the publisher if the assembly has been given a strong name.

  • Type Reference Information: Information used by the runtime to map a type reference to the file that contains its declaration and implementation. This is used for types that are exported from the assembly.


Type Metadata:


 


The other component of assembly is type metadata. Metadata can be defined as data about the data; this means the metadata contains all the information about the assembly. Metadata defines the contents of the assembly. Metadata contains information such as:



  • Classes that are there in the assembly.

  • Interfaces, Events, Indexers that are used in the assembly.

  • Structs and all the types' information.


MSIL Code


 


MSIL code is Microsoft intermediate language. The source code is compiled by .net compiler that will convert the source code into the IL code or MSIL code that is intermediate code and then this MSIL code that resides on PE file i.e. portable executable code convert into machine code using JIT with the help of CLR.


 


Types of Assembly:


 


There are three types of assembly.



  • Private Assembly:- These are those assemblies, which are used by single application and are stored in the application directory or a sub-directory beneath. Here the scope of this assembly is limited to the application itself and this assembly can't be shared by multiple assemblies. If you want to use this private assembly, you have to either copy this assembly or paste under the bin folder or you can create the reference of this assembly using the Add reference dialog box and use this assembly. The limitation with the private assembly is that it can't be accessed by two application.

  • Shared Assembly:- A shared assembly can be used by multiple assemblies. A shared assembly is normally stored in GAC (Global Assembly Cache), which is a repository of assemblies maintained by the .Net runtime. Shared assemblies are usually libraries of code which many applications will find useful e.g. crystal report classes which will be used by all application for reports.

  • Satellite Assembly:- In multi lingual application in .Net to support multilingual functionality you can have modules which are customized for locations. These assemblies are called as satellite assemblies. Here in these assemblies we can distribute these assemblies separately than the core modules.




  << Prev: Steps to Run a program in CLR Next: GAC (Global Assembly CACHE) >>
Dotnet Tutorial Home
Give feedback and win a prize.

 
   Printer Friendly
   Email to a friend
   Add to my Favourites    
  Download PDF version
   Report Bad Submissions
   Submit Feedback
 
  Delicious   Digg   Technorati   Blink   Furl   Reddit   Newsvine   Google Click each image to add
this page to each site.
 
 
Welcome Guest Signup
MEMBER'S PANEL
EMAIL
PASSWORD
Forgot your password?
New User? Click Here!
 
Resend Activation Email!
 
SEARCH
 
 
LINKS
MSN
Video Surveillance
Skype vs. sipcall
Gift to Pakistan
 
ADVERTISEMENT
 
PARTNER LIST

More
 
 
 

Home | Login | About Us | Contact Us | Privacy Policy | Advertising