In Ultimate Software (the company that I work for) we build all the assemblies in the same directory. Let say it’s C:\Common. When we need to reference an assembly, we browse to C:\Common directory and select a desired assembly.
I decided to look what we need to do to add our assemblies into .NET tab of “Add Reference” dialog box. It’s quite simple actually. All we need to do is to create a registry entry.
First lets assume that we want to reference AssemblyReference.dll that located in C:\Common directory. It’s probably not going to surprise anybody if I tell you that you’ll not find it in “.NET” tab of Add Reference dialog.
As you can see it’s not there at the moment. However, if we chose a “Browse” tab and navigate to C:\Common directory will be able to find it.
I just want to point out that adding an assembly to GAC will not add that assembly to the .NET tab’s list. It’s also not a good practice to install an assembly to the Global Assembly Cache, unless you want to share that assembly with other applications running on that computer.
Therefore only thing we need to do add our assembly to .NET tab’s list is to create a unique sub-key under
If you’re running a 64-bit OS you will need to create it under:
.NETMinimumVersion is the lowest .NET Framework version from which the assembly can be referenced. In our example I chose version 2.0.50727 as you can see below.
After creating a new sub-key, we’ll change its default string value to the “C:\Common\” directory path.
After restarting Visual Studio 2010, we can find our AssemblyReference assembly in .NET tab’s list of Add Reference dialog.
In our example we added the sub-key under HKEY_LOCAL_MACHINE node that allows all the users on this system to see AssemblyReference.dll. If we wanted only the current user to see this assembly, we would create our sub-key under HKEY_CURRENT_USER instead.
Note for VS 2008 and earlier:
For Visual Studio 2008 and earlier you need to add your sub-key under