من قبل
Kashif Akhter , VP - Wing Head Application Development , National Bank of Pakistan
computer where the common language runtime is installed has a machine-wide code cache called the global assembly cache. The global assembly cache stores assemblies specifically designated to be shared by several applications on the computer. For managing it with SN key please visit.......
http://support.microsoft.com/kb/815808
The GAC is like a global repository of assemblies available for all applications in the machine.
To be able to put an assembly in the GAC, this one must have a strong name(a compistion of its name, version, culture, a public key and a signature) wich make it unique (so we can have multiple instances of the same assembly having different version or culture).
The SN.exe is a tool to give a strong name to an assembly, we can also give a strong name using Visual Studio
GAC (Global Assembly Cache)
Basically it's a way to keep shared .net assemblies globally accessible without worrying about conflicts. No more DLL Hell. Each architecture and version gets it's own place to live. It is assigned with a unique SN Key to mange it.
please refer this link:
http://msdn.microsoft.com/en-us/library/k5b5tt23%28v=vs.80%29.aspx
http://support.microsoft.com/kb/815808
Hope you find the answer helpful
من قبل
Najmal Karuthedath , Dot Net Developer , Dicetek
GAC (Global Assembly Cache) is used where shared .NET assembly reside. GAC is used in the following situations :-
-> If the application has to be shared among several application.
-> If the assembly has some special security requirements like only administrators can remove the assembly. If the assembly is private then a simple delete of assembly the assembly file will remove the assembly.
Note :- Registering .NET assembly in GAC can lead to the old problem of DLL hell, where COM version was stored in central registry. So GAC should be used when absolutely necessary.
Strong name is similar to GUID(It is supposed to be unique in space and time) in COM
ong Name is only needed when we need to deploy assembly in GAC. Strong
Names helps GAC to differentiate between two versions. Strong names use public key cryptography (PKC) to ensure that no one can spoof use public key and private key concept. Following are the step to generate a strong name and sign a assembly :-
-> Go to “Visual Studio Command Prompt”. See below figure “Visual studio Command Prompt”.
-> After you are in command prompt type -k “c:\”.
-> After generation of the file you can view the SNK file in a simple notepad.
-> After the SNK file is generated its time to sign the project with this SNK file.
-> Click on project -- properties and the browse the SNK file to the respective folder and compile the project.