Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Net
What is Assemblies in .Net?
So now, lets Get Started with Assemblies .Net and understand concept of Assemblies
in .Net by easy step by step explanation.
What is Assembly Manifest?
Assembly Manifest contains the metadata for the assembly.
Example, Assembly Manifest contains
o Name and Version Information of Assembly.
o Files (or Resource) that are made up the assembly.
o Set of permissions required for the assembly to run properly.
o And few other details depends on assembly.
How Assembly Manifest is useful?
When the Common Language Runtime (CLR) loads an assembly, it first reads the
manifest to get the information regarding assembly.
Benefits of Assemblies?
1. It is used in Versioning
2. For Type Identification
3. For Security
4. For Deployment
5. For Referencing.
6. Improving Application Performance
7. Better Code Management and Maintenance
How Assembly can be used for Better Code Management and Maintenance
As we use Componentization(refer above description), if a code change require you
need to change the component code compile it, so you do not require to change all the
reference of code for minor change. For better understanding understand the example of
component given below.
Types of Assemblies in .Net
Static and Dynamic Assemblies
Single-File and Multifile Assemblies
Private and Shared Assemblies
Satellite and Resource-only Assemblies
What is Static Assembly?
A static assembly is created when you compile the program using any of the .NET
language compilers. A static assembly contains the types, interfaces, and various
resources required by the assembly. A static assembly is stored on the hard disk in the
form of a portable executable (.exe or .dll) file. In a simple term, when you compile
through VS.Net it generates files which are physically stored on the disk, this files are
called static assembly.
What is Dynamic Assembly?
Assemblies which are created and execute on the fly are called dynamic assembly. You
can create dynamic assembly through System.Reflection.Emit namespace.
What is Single-File Assembly?
A single-file assembly consists of a single .exe or .dll file.
Example of Single File Assembly
In the example the Shape.dll generated is a Single File Assembly.
What is Multifile Assembly?
A multifile assembly is an assembly that can include multiple file, but it should
contain atleast one .dll or .exe file.
Assembly manifest in multifile assembly can be attached to any assembly file or
can be created seperately just the manifest.
What is Satellite Assembly?
Resource-only assemblies are assembly's that stores only resource and no code. example,
Image. Resource-only assemblies that store the culture-specific information are known as
satellite assemblies.
When you view the GAC, note that some assemblies have their type marked as native
images, meaning that these assemblies were precompiled in native code before they were
installed in the native image cache. The advangate of using a native image is that even the
first call of any method in an assembly will be as fast as its subsequent calls. You too can
create a native image for your assembly by using the Native Image Generator Tool,
ngen.exe, which is installed as part of .net framework.