以编程方式将强命名程序集添加到 GAC

发布于 2024-08-01 19:58:17 字数 54 浏览 0 评论 0原文

是否可以使用 C# 代码以编程方式将强命名程序集添加到 GAC 中?

谢谢

Is there anyway to programmatically add a strong named assembly to the GAC using C# code ?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

清风不识月 2024-08-08 19:58:17

此 Microsoft 支持文章如何在 Visual C# 中将程序集安装到全局程序集缓存中,应该解释你需要知道的一切。

这通常是由安装程序执行的任务,因此我不确定您为什么要在 .NET 程序中执行此操作(除非我误解了您的问题)。 但是,您可以简单地使用 System.Diagnostics.Process 类来像安装程序一样运行所有必要的程序。

This Microsoft Support article, How to install an assembly into the Global Assembly Cache in Visual C#, should explain all you need to know.

This is typically a task performed by the installer, so I'm not sure why you'd want to do it from within a .NET program (unless I've misunderstood your question). However, you can simply use the System.Diagnostics.Process class to run all the necessary programs as an installer might.

遥远的她 2024-08-08 19:58:17

只需调用 gacutil 命令

gacutil /i mydll.dll

just call gacutil command

gacutil /i mydll.dll
暖伴 2024-08-08 19:58:17

全局程序集缓存是通过类似 COM 的接口进行配置的 (http ://support.microsoft.com/default.aspx?scid=kb;en-us;317540)。

对于所有有关 GAC 的问题,张俊芬的博客是首选来源。
http://blogs.msdn.com/junfeng/articles/229648.aspx
http://blogs.msdn.com/junfeng/articles/229649.aspx

有关更多信息,请搜索“托管 GAC API”。

Gacutil.exe 仅用于开发
目的,并且不应用于
将生产组件安装到
全局程序集缓存。

推荐使用[Microsoft Installer]
添加程序集的最常见方法
到全局程序集缓存。 这
安装程序提供引用计数
全局装配中的装配数量
缓存,以及其他好处。

The Global Assembly Cache is configured through a COM-like interface(http://support.microsoft.com/default.aspx?scid=kb;en-us;317540).

For all questions about the GAC, Jungfen Zhang's blog is the source of choice.
http://blogs.msdn.com/junfeng/articles/229648.aspx
http://blogs.msdn.com/junfeng/articles/229649.aspx

For more information, search for "managed GAC API".

Gacutil.exe is only for development
purposes and should not be used to
install production assemblies into the
global assembly cache.

[Microsoft Installer] is the recommended
and most common way to add assemblies
to the global assembly cache. The
installer provides reference counting
of assemblies in the global assembly
cache, plus other benefits.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文