Showing posts with label GAC. Show all posts
Showing posts with label GAC. Show all posts

Monday, June 17, 2013

Assemblies and Side-by-Side Execution

Let us consider that we have 2 applications A & B in a system, where A is an old application using an older version (say x1) of an assembly, not B is a new application and wants to use a new version (say x2) of the same assembly, how can this be achieved?

If the Assemblies are private assemblies then we don’t have an issue as the applications A & B will contain their own version of the assembly in their application folder and use the assemblies independently. But what is the assembly is a shared assembly, how can be maintain and use 2 different versions of the same assembly? This is where side-by-side execution comes into play.

What is a Global Assembly Cache (GAC)

The Global Assembly Cache (GAC) is a common folder where the shared assemblies are placed. The GAC folder is placed in one of the following folders.

X:/Windows/assembly
(or)
X:/Winnt/assembly

Where X: is the driver where the .Net framework in installed, it might vary from machine to machine based on where the .Net Framework is installed.

For an Assembly to be placed in the GAC, it should be signed with a strong name key, generated using the sn.exe utility. Once the assembly is signed with the key and is ready for deployment, it can be deployed in the GAC in one of the following ways.