如何找出需要GAC进行特定组装的应用程序? [英] How to find out which application requires a certain assembly from GAC?

查看:82
本文介绍了如何找出需要GAC进行特定组装的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我继承了一个使用Microsoft Enterprise Library的应用程序。应用程序的VS解决方案包含大约200个项目。

I have inherited an application, that uses Microsoft Enterprise Library. The VS solution of the applications contains about 200 projects.

我一直在调整解决方案,以移动项目并删除过时的项目。我需要整理一下才能为其他开发人员使用。

I have been restructuring the solution moving the projects around and removing obsolete ones. I need to tidy it up to make it ready for other developers.

该解决方案包含特定版本的Microsoft Enterprise Library dll,但是当我四处移动时,我注意到

The solution contains Microsoft Enterprise Library dlls of a specific version, however when I moved stuff around, I noticed that some projects do not reference these dlls but instead dlls from my GAC.

我需要确保解决方案不依赖于安装的其他任何东西(在GAC或否则),或者记录下来(如果有的话),因此下一个人从源代码管理中将其拉出时不会感到讨厌。

I need to make sure that the solution either do not depend on anything else installed (in GAC or otherwise) or document if it does, so the next person do not have a nasty surprise when pulling it from source control.

我试图从GAC中删除企业库dll。 。这样失败了:

I tried to removed the Enterprise Library dlls from GAC. It is failed like this:

C:\WINDOWS\system32>gacutil /u Microsoft.Practices.EnterpriseLibrary.Common
Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.0
Copyright (c) Microsoft Corporation.  All rights reserved.


Assembly: Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=e44a2bc38ed2c13c, processorArchitecture=MSIL
Unable to uninstall: assembly is required by one or more applications
Pending references:
              SCHEME: <WINDOWS_INSTALLER>  ID: <MSI>  DESCRIPTION : <Windows Installer>
Number of assemblies uninstalled = 0
Number of failures = 0

此消息使我认为此dll被Windows Installer(MSI)安装的应用程序引用。

This message makes me think that this dll is referenced by an application installed with Windows Installer (MSI).

我的机器没有Microsoft Enterprise Library作为控件中的一项。面板/程序和功能。

My machine does not have Microsoft Enterprise Library as one of the items in the Control Panel / Programs and Features.

如何找出安装在gac中的DLL的MSI安装产品?

How do I find out which MSI-installed product installed the DLL in gac?

编辑:不是欺骗。另一个问题询问流程浏览器未在GAC中显示该程序集的情况,KB正在讨论一种情况,即使该程序集未被任何引用都无法删除该程序集。另一个问题的过程浏览器部分与我无关,因为我不希望程序集始终加载。 kb响应也无济于事,因为我不想删除我想找出要安装什么程序的程序集。其他问题的答案不能回答这个问题(因为那不是这里要问的),但是幸运的是,我在 here 那里得到了高质量的答案。

EDIT: not a dupe. The other question asks about a situation when the assembly is not shown in GAC by the process explorer, and KB is talking about a situation when an assembly cannot be deleted even if it is not referenced by anything. The process explorer part of that other question is irrelevant to me, as I do not expect the assembly to be loaded all the time. The kb response also does not help since I do not want to delete the assembly I want to find out what program installed that. That other question answers do not answer that (because that's not what was asked there), but luckily I got quality answers here.

推荐答案

对我而言,快速有效的方法是打开cmd提示符,转到c:\windows\installer并执行findstr:

The quick and dirty way that's always worked for me is to open a cmd prompt, go to c:\windows\installer and do a findstr:

findstr / s -i -m AssemblyName.dll * .msi

findstr /s -i -m AssemblyName.dll *.msi

如果发现任何命中,您将在短时间内获得一个或多个文件以.msi结尾的哈希名称。使用Windows Installer数据库编辑器 ORCA(安装平台SDK或google ORCA.msi)检查每个数据库,并查看其中的哪个数据库具有将所述文件安装到GlobalAssemblyCache目录的组件。如果MsiAssembly表中存在一个程序集,并且File_Application字段为空,则表示该程序集已安装到GAC。
找到它后,查看属性表和摘要信息流(顶部菜单->视图->摘要信息)以识别缓存的MSI代表什么产品。

If you find any hits you'll get back one or more files with a short hashed name ending in .msi. Use the Windows Installer Database Editor "ORCA" (install platform SDK or google ORCA.msi ) to examine each of these databases and see which of these has a component that installs said file to the GlobalAssemblyCache directory. If an assembly is present in the MsiAssembly table and File_Application field is empty then it's being installed to GAC. Once you find it, look at the Property table and Summary Information Stream (top menu -> View -> Summary information) to identify what product the cached MSI represents.

这篇关于如何找出需要GAC进行特定组装的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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