zoukankan      html  css  js  c++  java
  • How to reference Assemblies in the GAC

    From: http://www.eggheadcafe.com/PrintSearchContent.asp?LINKID=1175

    We have been getting some posts lately where developers are installing assemblies in the GAC and then asking why they don't see them enumerated in the Add Reference dialogs. This should clear things up for most developers.


    If you install assemblies in the GAC and then wonder why you don't see them enumerated in the Add Reference dialogs, or, if you are complaining that if you browse the assembly folder in the Windows directory, you can't see the assembly in order to add a reference to it, read on.

    The Add Reference dialog box is path-based and does not enumerate the components from the GAC. The assembly folder under windows is a special folder view and so you cannot browse to an assembly from this folder and expect to be able to Add a reference to it in the normal way.

    If you want to use an assembly from the GAC, you should drop your assemblies into a local folder, and then add a reference to the assembly from this folder. You may want to set the "Copy Local" property to False for that assembly if you do not want the assembly to be copied locally to your project folders. At runtime, the application will automatically use the assembly from the GAC.

    How to make your custom assemblies appear in the Add Reference dialog:

    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
    [HKEY_CURRENT_USER\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\MyAssemblies]@="C:\\MyAssemblies"
    -- where "MyAssemblies" is the name of the folder in which the assemblies reside.

    NOTE: You can create the this registry entry under the HKEY_LOCAL_MACHINE hive. This will change the setting for all of the users on the system. If you create this registry entry under HKEY_CURRENT_USER, this entry will affect the setting for only the current user.

    For more information about assemblies and the GAC, vist the following MSDN Web Page:

    http://msdn.microsoft.com/library/en-us/cpguide/html/cpconglobalassemblycache.asp
  • 相关阅读:
    MAVEN 配置阿里云源
    Windows10远程连接CentOS7(搭建Xrdp服务器)
    在jsp显示图片
    unbuntu自动任务定时重启
    eager模式与自定义训练
    JDK安装
    VMware克隆Linux虚拟机注意事项
    系统字符编码
    Iptables防火墙
    查看系统信息
  • 原文地址:https://www.cnblogs.com/smwikipedia/p/1701384.html
Copyright © 2011-2022 走看看