以编程方式将强命名程序集添加到 GAC
是否可以使用 C# 代码以编程方式将强命名程序集添加到 GAC 中?
谢谢
Is there anyway to programmatically add a strong named assembly to the GAC using C# code ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
此 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.只需调用 gacutil 命令
just call gacutil command
全局程序集缓存是通过类似 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”。
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".