Sunday 12 July 2015

GAC and Assembly

What is GAC?

The Global Assembly Cache (GAC) is a folder in Windows directory to store the .NET assemblies that are specifically designated to be shared by all applications executed on a system.

The concept of GAC is the result of the .NET architecture whose design addresses the issue of "DLL hell" that existed in COM (Component Object Model).


What is Assembly?

Unlike in COM, there is no need for the assembly in GAC to be registered before its use.

Each assembly is accessed globally without any conflict by identifying its name, version, architecture, culture and public key.

below you can know more about Assembly

An assembly is a collection of types and resources that forms a logical unit of functionality.

When you compile an application, the MSIL code created is stored in an assembly .
Assemblies include both executable application files that you can run directly from Windows without the need for any other programs (these have a .exe file extension), and libraries (which have a .dll extension) for use by other applications.

There are two kind of assemblies in .NET;

  • private
  • shared

Private assemblies are simple and copied with each calling assemblies in the calling assemblies folder.

Shared assemblies (also called strong named assemblies) are copied to a single location (usually the Global assembly cache). For all calling assemblies within the same application, the same copy of the shared assembly is used from its original location. Hence, shared assemblies are not copied in the private folders of each calling assembly. Each shared assembly has a four part name including its face name, version, public key token and culture information. The public key token and version information makes it almost impossible for two different assemblies with the same name or for two similar assemblies with different version to mix with each other.

No comments:

Post a Comment