May 30
When you attempt to add an assembly reference to a Visual Studio project, the Add Reference dialog appears with a list of registered global assemblies in the .NET tab:
Add Your Assembly to Visual Studio
Unfortunately, adding your assembly to the Global Assembly Cache (GAC) does NOT make it automatically appear in the Visual Studio list of installed assemblies; you must add your assembly manually as follows:
- Run regedit to edit the Windows Registry.
- Navigate to the HKEY_LOCAL_MACHINESOFTWAREMicrosoft.NETFrameworkAssemblyFolders key.
- Right click on the AssemblyFolders key, then select New > Key. Enter the name of your assembly (without the .dll extension).
- Double click on the key’s (Default) value. The Edit String dialog will appear. Enter the full path of the folder where your assembly resides. Note that all assemblies in that folder will appear in the Visual Studio list.
- IMPORTANT! You must exit and restart Visual Studio to see your assembly in the Add Reference dialog.
Multiple Versions of Same Assembly
Note that if you add multiple versions of the same assembly to the GAC, and you want all versions to appear in the Visual Studio list of installed assemblies, you have two options:
- Provide a different name for each version of the assembly, such as MyLib1.0.dll and MyLib2.0.dll, or
- Store each version of the assembly in its own folder, and add each folder to the registry as shown above.
Hello Timm,
I tried with your solution, and it works. It shows My ClassLib project dll in .NET API list for Add Reference Dialog box. But that is showing my dll in list though I uninstalled my dll from GAC. Then was is meaning of registering it in the GAC. This leads me to conclude that .Net API contains list of APIs registered on OS and not with GAC. Then what is the use of registering it to the GAC. If you know can you please give some more Idea about GAC?
Thanks & Regards
Sunil Waghmare.
Yes, you are correct. The list of assemblies in the GAC is different from the list of assemblies in Visual Studio.
See this post for why you would use the GAC:
http://www.devtopics.com/net-assembly-faq-part-4-global-assembly-cache/
Writing A Yougle Source…
OK, although this isn’t about GENERAL Media Center development and is more of a self-serving plug, I’m…
[…] Adding Assemblies to the Visual Studio “Add Reference” Dialog Original Article here. […]
on Vista and Windows 2008 x64 you need to add your folder to [
HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoft.NETFrameworkAssemblyFolders]
resp.
[HKEY_CURRENT_USERSOFTWAREWow6432NodeMicrosoft.NETFrameworkAssemblyFolders]
Hi,
I’ve created a tool which is completely free, that will help you to achieve your goal. Muse VSReferences will allow you to add a Global Assembly Cache reference to the project from Add GAC Reference menu item.
Regards,
Muse VSExtensions
yes sir it works thank u very much.
i have done all the things like creating key,editing
but not showing in “Add Reference” Dialog”