如何提取从GAC程序集?程序、GAC

2023-09-02 01:28:41 作者:我的祖墳在發光

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

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

感谢。

解决方案

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

  

获取DLL走出海关总署

     

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

     

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

        

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

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

打开%WINDIR%组装 GAC_MSIL。

  

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

  

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

  

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

  

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

.Net应用程序打包部署总结

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:windowsassembly) 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

Run regsvr32 /u C:WINDOWSMicrosoft.NETFrameworkv2.0.50727shfusion.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.

Open "%windir%assemblyGAC_MSIL".

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

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

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