How to display your own assembly in the "add reference" dialog box of Visual Studio (I found it online a long time ago, but I am sorry for the original author ..)

Source: Internet
Author: User

DLL added to GAC, which can be seen under c: \ windows \ assembly, but not in add reference

Solution 1: The "add reference" dialog box is displayed.ProgramSet
Even if you have installed the assembly in the Global Assembly Cache (GAC), The add reference dialog box does not automatically display each assembly. The add reference dialog box is based on the path and requires that the registry key be added. This option specifies the location of the assembly to be displayed.

The "add reference" dialog box displays the Assembly
Add one of the following registry items. <assemblylocation> is the Assembly directory to be displayed in the "add reference" dialog box, for example, C: \ myassemblies.

[HKEY_CURRENT_USER \ Software \ Microsoft \. netframework \ <version> \ assemblyfoldersex \ myassemblies] @ = "<assemblylocation>"

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \. netframework \ <version> \ assemblyfoldersex \ myassemblies] @ = "<assemblylocation>"

Note:
After you create a registry entry in the HKEY_LOCAL_MACHINE Configuration unit, all users can view the assembly at the specified location in the Add reference dialog box. Creating a registry entry in the HKEY_CURRENT_USER Configuration unit only affects the settings of the current user.

Restart Visual Studio.

Solution 2:
You can copy your DLL. net Framework directory (% WinDir % \ Microsoft. net \ framework \ v1.x. yyyy. you can achieve your goal. however, Ms suggests that we do not copy our Assembly to the Framework directory. A better way is to put them in a separate directory, and then add a key to Windows Registry to tell vs. Net where these assemblies can be found. In addition to the core framework assembly, vs. Net can also display any assembly: HKEY_CURRENT_USER \ Software \ Microsoft \. netframework \ assemblyfolders In the directories listed in the following registry keys
HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \. netframework \ assemblyfolders
HKEY_CURRENT_USER \ Software \ Microsoft \ visualstudio \ 7.1 \ assemblyfolders
HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ visualstudio \ 7.1 \ assemblyfolders

 

 

Here is the original Haha:

Assembly references for Silverlight are different:

The corresponding registry is:

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ microsoft sdks \ Silverlight \ [version] \ assemblyfoldersex

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.