Main menu

.Net: Assemblies (Part – 1)

Assemblies are the self-describing building blocks of .Net based applications. Assemblies contain Assembly manifest, which contains metadata information, contains a collection of data that describes the relationship between the elements in the assembly; Type metadata describing the exported types and methods; MSIL (Microsoft Intermediate Language) code that CLR (Common Language Runtime) executes; and a set of resources. All these parts can be in one assembly or spread across into several files.

Assemblies also contains references to other assemblies or modules. Assemblies contains one or more files and packaged in either .EXE files or in .DLL files.

There is a difference between normal DLL files and assembly DLL files. Normal DLL files doesn’t have manifest.

We can classify assemblies as either private assemblies or shared assemblies. Private assemblies are usually located in the application folders. Shared assemblies are commonly deployed into Global Assembly Cache (GAC). Shared assemblies are shared by several applications and have a dependency on it. Shared assemblies reduce the need for disk and memory space.

While creating shared assemblies, we must give the strong name to avoid naming or version conflicts with other assemblies. Strong names consists assembly name, version number, culture information and public key.

Lets create a simple assembly:

There are several ways to create assemblies. In this article we are using Visual C# & Visual Studio 2012 to create assemblies.

Let’s write a simple C# program, compile it and check how assemblies are created.

Featured Posts

As of now, we have created our window and successfully displayed on the screen. We have seen this in our previous article. And also we observed that the window is immediately closed; because of no user interaction code was added.…