Summary

When you are developing a class library, you may want Visual Studio .NET to list your library in the Add Reference dialog box on the .NET tab without the user having to browse for it.
This issue is not resolved if you install your assembly to the global assembly cache, because the Add Reference dialog box is path-based and does not enumerate the components from the global assembly cache.
To display your assembly in the Add Reference dialog box, you can add a registry key, such as the following, which points to the location of the assembly

[HKEY_CURRENT_USERSOFTWAREMicrosoft.NETFrameworkAssemblyFoldersMyAssemblies]@="C:\MyAssemblies"

where MyAssemblies is the name of the folder in which the assemblies reside.

NOTE: You can create the this registry entry under the HKEY_LOCAL_MACHINE hive. This will change the setting for all of the users on the system. If you create this registry entry under HKEY_CURRENT_USER, this entry will affect the setting for only the current user.

Restart Visual Studio .NET after you have added the key.

More Information

It is highly recommended that you not install your assemblies to the global assembly cache, unless you want to share your assemblies with other applications running on that system. Also, note that it is not possible to directly reference an assembly from the global assembly cache in your project. If you want to use an assembly from the global assembly cache, you should drop your assemblies to a local folder, and then add a reference to the assembly from this folder. You may want to set the Copy Local property to False for that assembly if you do not want the assembly to be copied locally to your project folders. At runtime, the application will use the assemblies from the global assembly cache.

If you install the .NET Framework 3.0 Service Pack 1 (SP1), the following registry subkey is added:
HKEY_LOCAL_MACHINESOFTWAREMicrosoft.NETFrameworkAssemblyFoldersv3.0

If you install the .NET Framework 3.5, the following registry subkey is added:
HKEY_LOCAL_MACHINESOFTWAREMicrosoft.NETFrameworkAssemblyFoldersv3.5

Note : These registry subkeys are added to support the new functions that are included in Object Browser. For more information about Object Browser, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn.microsoft.com/en-us/library/exy1facf(VS.71).aspx

References

For more information about assemblies and the global assembly cache, vist the following MSDN Web site:
http://msdn.microsoft.com/en-us/library/yf1d93sz(vs.71).aspx

For more information about the Add Reference dialog box, the following MSDN Web site:
http://msdn.microsoft.com/en-us/library/ftcwa60a(vs.71).aspx

1. GAC란?

GAC(Glocal Assembly Cache)란 마이크로소프트사의 CLR(Common Language Runtime) 플랫폼에 도입된 .NET 어샘플리 캐시입니다. 즉, 특수하게 관리되는 중앙 저장소를 두는 접근방법을 통해서 예전에 발생했던 DLL 지옥과 같은 문제가 발생하는것을 피하기 위한 공유 라이브러리라고 생각하시면 됩니다.

GAC에 존재하는 어셈블리들은 강력한 이름으로 서명되어 있기 때문에 동일한 이름이지만 버전이 틀린 여러개의 파일을 동시에 보관할 수 있습니다.

2. GAC의 몇가지 문제점

Global Assembly Cache 매커니즘은 예전의 DLL 지옥과 같은 문제를 피할 수 있게 해주지만, 아직 몇가지 결점을 가지고 있습니다.

Copyright zemna. All right reserved.