Home > DeveloperSection > Articles > GAC in .NET

GAC in .NET


.NET .NET 
Ratings:
0 Comment(s)
 3174  View(s)
Rate this:

GAC in .NET

Each computer where the common language runtime is installed has a machine-wide code cache called the global assembly cache. The global assembly cache stores .net assemblies specifically designated to be shared by several applications on the computer.

You should share assemblies by installing them into the global assembly cache only when you need to. As a general guideline, keep assembly dependencies private, and locate assemblies in the application directory unless sharing an assembly is explicitly required. In addition, it is not necessary to install assemblies into the global assembly cache to make them accessible to COM interop or unmanaged code.

You should share assemblies by installing them into the global assembly cache only when you need to. As a general guideline, keep assembly dependencies private, and locate assemblies in the application directory unless sharing an assembly is explicitly required. In addition, it is not necessary to install assemblies into the global assembly cache to make them accessible to COM interop or unmanaged code.

GAC in .NET

Use of GAC

Making two folder namely “service” and “consumer”

GAC in .NET

“show.cs” file save in “service” folder and “check.cs” file save in “consumer” folder

GAC in .NET

GAC in .NET

D:\ service>csc /t:library show.cs

ð  Show.dll is created

GAC in .NET

D:\consumer>csc /r:d:service\show.dll check.cs

D:\consumer>check.exe is created

GAC in .NET

D:\consumer>check

GAC in .NET

Authentication problem occurs

GAC in .NET

In the above snapshoot check.exe file not execute due to authentication problem. For solving this, make strong name and attached with cs file and then make dll. Mapped dll in assembly folder (C:\Windows\Assembly), with the help of gacutil command. This process called shared assembly.


Don't want to miss updates? Please click the below button!

Follow MindStick