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
  • 相关阅读:
    求两个字符串中相同的汉字及字母的个数
    将十进制转成十六进制
    综合模糊查询
    求第一个字符串中第二个串的个数
    去除字符串中连续的分割符
    去除字符串中的html标记及标记中的内容
    sql基础语句
    SQL Server2008函数大全(完整版)
    sql 数字转人民币大写函数(两种方法)
    数字转IP地址函数
  • 原文地址:https://www.cnblogs.com/smwikipedia/p/1701384.html
Copyright © 2011-2022 走看看