Add Your Assembly to Visual Studio Add Reference Dialog

When you add a reference to a project in Visual Studio there are several tabs to allow you to “quickly” pick an assembly to reference. The .net tab is the first and, at first glance, appears to show all assemblies registered in the Global Assmbly Cache (GAC). It is, however, not associated with the GAC in any way. It is simply a list of dlls that can be reference quickly. The dll’s listed in the .net tab do not have to be registered in the GAC. In order to get your dll to show up, you need to add a registry key that points to the folder where your dll resides. When Visual Studio starts up, it looks through all the folders listed in the associated registry keys and adds any dlls it finds (whether or not it is registered in the GAC) to the list of available dlls.

When you add a reference from the .Net tab, Visual Studio simply goes to the specified physical location of the dll and adds the appropriate reference (if it is a private assembly it copies the dll – if shared, it adds the reference to the GAC).

Here is the KEY Path.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders

To add your folder to the list:

  1. Right-Click the AssemblyFolders Key and select New -> Key
  2. Name the new Key
    1. The new key will have a default string with no value
  3. Add the path of your dll folder to the “(default)” string
  4. Restart Visual Studio and your dll will appear in the .Net tab


Categories: Misc

Tags:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: