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
  • 相关阅读:
    (转载)MP3 编码解码 附完整c代码
    (转载) 一个大概的框架
    (转载)音视频相关的书籍,多媒体技术
    js原生选项卡切换
    点击div删除div本身
    鼠标移入旋转动画
    鼠标移入,改变border颜色
    小白初建博客!
    java设计模式--六大原则
    java设计模式--策略模式
  • 原文地址:https://www.cnblogs.com/smwikipedia/p/1701384.html
Copyright © 2011-2022 走看看