Windows Update如何在GAC中安装.NET程序集?

时间:2014-11-27 21:54:24

标签: .net gac windows-update gacutil

考虑以下命令

gacutil /i Microsoft.Powershell.ConsoleHost.dll

这会将程序集安装到

C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.PowerShell.ConsoleHost

现在,考虑一台没有gacutil的其他计算机。你可以安装 this update也是如此 程序集将安装到同一个地方。如何安装此更新 全局程序集缓存没有gacutil

1 个答案:

答案 0 :(得分:2)

应使用安装程序安装任何程序集(在此特定情况下最有可能)。

来自MSDN: How to: Install an Assembly into the Global Assembly Cache

  

使用Windows Installer。这是将程序集添加到全局程序集缓存的推荐和最常用的方法。安装程序提供全局程序集缓存中程序集的引用计数以及其他好处。 [...] Gacutil.exe仅用于开发目的,不应用于将生产程序集安装到全局程序集缓存中。

来自MSDN: Installation of Assemblies to the Global Assembly Cache

  

Windows Installer使用Microsoft .NET Framework将公共语言运行库程序集安装到全局程序集缓存中。

来自MSDN: DOC: Global Assembly Cache (GAC) APIs Are Not Documented in the .NET Framework Software Development Kit (SDK) Documentation(通过SO: Drag and drop a DLL to the GAC (“assembly”) in windows server 2008 .net 4.0):

  

.NET Framework软件开发工具包(SDK)文档中未记录允许您与全局程序集缓存(GAC)交互的本机代码应用程序编程接口(API)。

实际安装似乎是通过IAssemblyCache::InstallAssembly()进行的。

相关问题