Adding Assemblies to the Visual Studio “Add Reference” Dialog(收集)

來源:互聯網
上載者:User
文章目錄
  • Add Your Assembly to Visual Studio
  • Multiple Versions of Same Assembly

When you attempt to add an assembly reference to a Visual Studio project, the Add Reference dialog appears with a list of registered global assemblies in the .NET tab:

Add Your Assembly to Visual Studio

Unfortunately, adding your assembly to the Global Assembly Cache (GAC) does NOT make it automatically appear in the Visual Studio list of installed assemblies; you must add your assembly manually as follows:

Run regedit to edit the Windows Registry.

  1. Navigate to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders key.
  2. Right click on the AssemblyFolders key, then select New > Key. Enter the name of your assembly (without the .dll extension).
  3. Double click on the key's (Default) value. The Edit String dialog will appear. Enter the full path of the folder where your assembly resides. Note that all assemblies in that folder will appear in the Visual Studio list.
  4. IMPORTANT! You must exit and restart Visual Studio to see your assembly in the Add Reference dialog.
Multiple Versions of Same Assembly

Note that if you add multiple versions of the same assembly to the GAC, and you want all versions to appear in the Visual Studio list of installed assemblies, you have two options:

  1. Provide a different name for each version of the assembly, such as MyLib1.0.dll and MyLib2.0.dll, or
  2. Store each version of the assembly in its own folder, and add each folder to the registry as shown above.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.