Coding with passion

首页 新随笔 联系 订阅 管理

We have developed a class library. Then we'll send this library to other teams. We want to make our library appear in the "Add Reference" dialog box in Visual Studio. So that the class library users can add references easily. Just like they add a reference to some system dlls, such as System.dll, System.Data.dll, etc. They just need to click their mouse several times, no copy/paste operations any more. But how? It seems it don't work even if we store out assemllies into the GAC.

Actually, it's very simple to implement the function. The "Add Reference" dialog box is just path-based and does not enumerate components from the GAC. We need to tell Visual Studio the path to the assembly. The detailed steps include:

  • Run regedit, and search for the registry key HKEY_CURRENT_USER\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders.
  • Create a sub registry key with any name your prefer, and set the full path to the assembly as its default value.
  • Then you can see your assembly displayed in the "Add Reference" dialog box.

posted on 2007-08-27 22:50  Kellin  阅读(176)  评论(0编辑  收藏  举报