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

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

问题描述

有一个我必须处理的包,它将程序集直接安装到 GAC 中(例如,在 %windows%/assembly 深处的某个地方).

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

如何将实际程序集(DLL)从 GAC 驱除到普通文件系统中?

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

谢谢.

推荐答案

我使用了来自 这篇文章 从 GAC 获取程序集.

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

从 GAC 中取出 DLL

DLL 一次部署在 GAC(通常位于c:windowsassembly) 无法查看或用作普通的 DLL 文件.他们不能直接从VS引用项目.开发人员通常会保留一个原始 DLL 文件的副本和在项目中引用它开发(设计)时间,它使用运行时来自 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.

在执行(运行时)期间,如果发现程序集已签名并且在 GAC 中自动部署 CLR从 GAC 那里拿起程序集而不是期间引用的 DLLVS 中的设计时间.万一开发者删除了原来的DLL或者因为某种原因没有它,有一种方法可以获取 DLL 文件来自广汽.请按照以下步骤操作从 GAC 复制 DLL

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

  1. Run regsvr32 /u C:WINDOWSMicrosoft.NETFrameworkv2.0.50727shfusion.dll

  • shfusion.dll 是一个资源管理器扩展 DLL,它提供了一个独特的查看 GAC 文件夹.注销此文件将删除程序集缓存查看器和 GAC 文件夹将然后作为任何普通文件夹可见在资源管理器中.

打开%windir%assemblyGAC_MSIL".

Open "%windir%assemblyGAC_MSIL".

浏览您的 DLL 文件夹,深入查找您的 DLL.

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

将 DLL 复制到硬盘上的某个位置,然后从那里引用它项目

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

运行regsvr32 %windir%Microsoft.NETFramework<.NET版本目录> shfusion.dll"到重新注册 shfusion.dll 文件和恢复原来的清晰视野GAC.

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.

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

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