如何提取从GAC程序集? [英] How to extract an assembly from the GAC?

查看:316
本文介绍了如何提取从GAC程序集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个包我必须处理它安装组件直接进入GAC(如某处深在%WINDOWS%/组装)。

我如何驱除从GAC实际汇编(DLL)进入正常的文件系统?

感谢。

解决方案

我从这篇文章获得来自海关总署的程序集。

  

获取DLL走出海关总署

     

DLL文件,一旦   部署在GAC(通常位于   C:\ WINDOWS \组装)无法查看   或用作正常DLL文件。他们   不能从VS直接引用   项目。开发人员通常保持   原来的DLL文件的副本,   提到它的项目,   发展(设计)时,它使用   从海关总署在运行时组件   该项目。

     

在执行过程中(运行时间),如果   组件发现签名,   CLR的自动部署在GAC   拿起从GAC大会   而不是在引用的DLL   设计时VS.万一   开发者已经删除了原来的DLL   或没有它由于某种原因,   有一种方式来获得DLL文件   来自海关总署。请按照以下步骤   复制DLL从海关总署

     
      
  1. 运行REGSVR32 / U C:\ WINDOWS \ Microsoft.NET \框架\ V2.0.50727 \ Shfusion.dll的

         
        
    • 在Shfusion.dll的是一个资源管理器扩展DLL,给出了一个独特的   看向GAC文件夹。注销   该文件将删除组件   缓存观众和GAC文件夹   是那么可见,因为任何正常的文件夹   在资源管理器。
    •   
  2.   
  3. 打开%WINDIR%\组装\ GAC_MSIL。

  4.   
  5. 浏览到您的DLL文件夹进深找你的DLL。

  6.   
  7. 在某处复制DLL在硬盘上,并从那里引用它在你的   项目

  8.   
  9. 运行REGSVR32%WINDIR%\ Microsoft.NET \框架\< .NET   版本目录> \ Shfusion.dll的到   重新注册Shfusion.dll的文件和   恢复原来不同的看法   海关总署。

  10.   

There is a package I have to deal with which installs assemblies straight into the GAC (e.g. somewhere deep in %windows%/assembly).

How do I exorcise the actual assembly (the DLL) from the GAC into the normal file system?

Thanks.

解决方案

I used the advice from this article to get an assembly from the GAC.

Get DLL Out of The GAC

DLLs once deployed in GAC (normally located at c:\windows\assembly) can’t be viewed or used as a normal DLL file. They can’t be directly referenced from VS project. Developers usually keep a copy of the original DLL file and refer to it in the project at development (design) time, which uses the assembly from GAC during run-time of the project.

During execution (run-time) if the assembly is found to be signed and deployed in GAC the CLR automatically picks up the assembly from the GAC instead of the DLL referenced during design time in VS. In case the developer has deleted the original DLL or don't have it for some reason, there is a way to get the DLL file from GAC. Follow the following steps to copy DLL from GAC

  1. Run regsvr32 /u C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll

    • shfusion.dll is an explorer extension DLL that gives a distinct look to the GAC folder. Unregistering this file will remove the assembly cache viewer and the GAC folder will be then visible as any normal folder in explorer.
  2. Open "%windir%\assembly\GAC_MSIL".

  3. Browse to your DLL folder into the deep to find your DLL.

  4. Copy the DLL somewhere on your hard disk and refer it from there in your project

  5. Run "regsvr32 %windir%\Microsoft.NET\Framework\<.NET version directory> \shfusion.dll" to re-register the shfusion.dll file and regain the original distinct view of the GAC.

这篇关于如何提取从GAC程序集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆