How to see your GAC-assemblies in the "add reference" dialog

IMHO it's a pity that you don't see every GAC-installed assembly when you do "add reference" from Visual Studio, and I couldn't find much information in the VS documentation about this. So I Googled around a bit and found these ways (I haven't tried them yet):

  • Put a copy of your assembly in C:\WINNT\Microsoft.NET\Framework\v1.0.3705  or  C:\WINNT\Microsoft.NET\Framework\v1.1.4322 or wherever your framework is installed
  • Add a new registry key under one of the following registry paths with a default value that points at the location of your assemblies.:
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders  (I found WSE, NUnit and the Primary Interop Assemblies here).
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\AssemblyFolders (this is for VS.NET 2003 I think)
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\AssemblyFolders (this is for VS.NET 2002 I think)
  • Put a copy of the assembly in the directory C:\Program Files\Microsoft Visual Studio\Common7\IDE\PublicAssemblies or, if you got VS.NET 2003, in the C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\PublicAssemblies directory.

I'm not sure yet, what the best choice is. According to the readme-file in the PublicAssemblies-directory:

"The PublicAssemblies folder is designed to contain managed assemblies that run within the development environment and are typically called from macros, add-ins, and other user code. The assemblies in this directory are displayed in the Project Add References dialog box and the Object Browser's Component Selector dialog box. For example, COM interoperability wrappers for automation object models (e.g. vslangproj.dll) should be installed in the PublicAssemblies folder."

I'll try the different options and see what happens, but I think I prefer to put my assemblies into a directory of my own, like C:\MyGACFiles\ and then add a "MyGACFiles" key to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders section.

Anyone with good experience with this? Is it changed in Whidbey so that you get a list of GAC-ed assemblies in the "add reference" dialog?

Published Tuesday, December 16, 2003 4:44 PM by jdanforth


No Comments