C# Source Code: VS.NET tip: Adding your assemblies to the references in the "Add Reference" dialog
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
C# Source Code
VS.NET tip: Adding your assemblies to the references in the "Add Reference" dialog
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Wednesday, March 09, 2005
Hits:
1151
Category:
General/Framework
Article:
When you are developing a class library, you may want Visual Studio .NET to list your library in the Add Reference dialog box on the .NET tab without the user having to browse for it. This issue is not resolved if you install your assembly to the Global Assembly Cache (GAC), because the Add Reference dialog box is path-based and does not enumerate the components from the GAC. To display your assembly in the Add Reference dialog box, you can add a registry key, such as the following, which points to the location of the assembly: To update the current user only use: REGEDIT4 [HKEY_CURRENT_USER\Software\Microsoft\.NETFramework\AssemblyFolders\MyAssembliesFolder] @="C:\\Program Files\\MyAssembliesFolder" To update the local machine use: REGEDIT4 [HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\AssemblyFolders\MyAssembliesFolder] @="C:\\Program Files\\MyAssembliesFolder" Note, to add this key to the registry you can save the above in a file and rename the file to "MyRegKey.reg" then open this file and it will automatically insert the appropriate registry key. WARNING: There seems to be a bug in which adding this key can cause incorrect project references to be loaded if you have multiple versions of the assemblies. Fusion seems to probe the path contained in this, before it probes your appbase.
Terms and Conditions
Support this site
Download a trial version of the best FTP application on the internet