views:

584

answers:

2

I'm having a problem adding a reference to a .NET assembly I built. Here's what I did.

  1. I created a .NET assembly (testlib.dll).
  2. I made sure it had a strong name (added a keyfile).
  3. I creates a WiX installation project for that assembly.
  4. I added Assembly='.net' and KeyPath='yes' to the File property for the assembly.

The installation works fine. I can see testlib in the GAC (C:\Windows\assembly).

I create a new .NET project and try to add a reference to testlib, but I don't see it in the .NET tab of the Add Reference dialog. How do I get it to show up there?

+1  A: 

The assemblies that are in the .NET tab have no connection to the GAC. In order to see the assemblies in the .NET tab your installer will have to write to the following registry path: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\AssemblyFolders The entry should create a new key usually the application name and than set the default value to the path that the assemblies are installed.

For example assuming the application name is MyApp and it is installed to: C:\Program Files\MyApp The registry full path will be HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\AssemblyFolders\MyApp And the default value will be: C:\Program Files\MyApp

Ohad Horesh
A: 

Hi Ferruccio,

We've created a tool 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