Accessing GAC DLL’s in Visual Studio 2010 “Find References”

Or better titled I’ve just registered my DLL in the GAC, why does it not appear in Visual Studio’s “Find Reference” dialog.

It’s probably the first thing people notice after they’ve started using the GAC for the first time. You’ve managed to register your DLL and you’ve confirmed it is in the GAC, but it just won’t appear in Visual Studio’s “Add Reference” dialog box.   As it turns out, for what were probably good reasons, the visual studio team decided to use the registry to hold the list of DLLs that appear in the “Add Reference” dialog box.

You have two options, the first is to manually edit the registry – adding your DLL to the following registry keys:

  • [HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoft.NETFrameworkAssemblyFolders]
  • [HKEY_CURRENT_USERSOFTWAREWow6432NodeMicrosoft.NETFrameworkAssemblyFolders]

Another option is to install the Visual Studio extension MUSE.VSExtensions, which adds an extra option to the context-sensitive menu when you right-mouse click on “References”.  The extra option is “Add GAC Reference” which pops up a new dialog box listing all the items currently held in the GAC – no messing around in the registry each time you add something new to the GAC.  It is worth noting that the search is case sensitive.

See Adding a DLL to the GAC in .NET 4.0 for more information on adding DLL’s to the GAC in .NET 4.0 and differences between this and earlier versions of the framework.

Similar Posts

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *