C#如何注册装配在GAC没有GACUTIL? [英] C# how to register assembly in the GAC without GacUtil?

查看:920
本文介绍了C#如何注册装配在GAC没有GACUTIL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用批处理文件在GAC中注册程序集。有没有办法找到安装位置的Gacutil.exe 还是有不GACUTIL注册程序集的方式?

I need to register an assembly in the GAC using batch file. Is there a way to find the installation location of GacUtil.exe or is there a way to register the assembly without GacUtil?

推荐答案

GACUTIL不与框架安装只安装一个SDK安装 - 所以你不能保证它会在你安装在包装盒上。

GacUtil is not installed with a framework install only with an SDK install - so you couldn't guarantee it would be on the box you're installing on.

这将不是你的批处理文件中工作,但如果你已经开发出下面你可以使用GacInstall方法的应用程序描述自己:

<一href=\"http://msdn.microsoft.com/en-us/library/system.enterpriseservices.internal.publish.gacinstall.aspx\">http://msdn.microsoft.com/en-us/library/system.enterpriseservices.internal.publish.gacinstall.aspx

This won't work within your batch file but if you have developed the application yourself you can use the GacInstall method described below:
http://msdn.microsoft.com/en-us/library/system.enterpriseservices.internal.publish.gacinstall.aspx

另外我建议你产生一个msi文件部署应用程序。教程在这里:
<一个href=\"http://www.dreamin$c$c.net/forums/topic/58021-deploying-a-c%23-application-visual-studio-setup-project/\">http://www.dreamin$c$c.net/forums/topic/58021-deploying-a-c%23-application-visual-studio-setup-project/

Alternatively I'd recommend producing an msi file to deploy the application. Tutorial here:
http://www.dreamincode.net/forums/topic/58021-deploying-a-c%23-application-visual-studio-setup-project/

这将是一个不明智的解决方案包括的Gacutil.exe的副本分发因为它是根据不同的许可证,你可能没有许可重新分配

It would be an inadvisable solution to include a copy of GacUtil.exe in your distribution because it comes under a different licence and you probably aren't licenced to redistribute it

这篇关于C#如何注册装配在GAC没有GACUTIL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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