使用Visual Studio安装项目以自动注册和GAC一个COM互操作DLL [英] Use Visual Studio Setup Project to automatically register and GAC a COM Interop DLL

查看:511
本文介绍了使用Visual Studio安装项目以自动注册和GAC一个COM互操作DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个.NET程序集的COM互操作,并运作良好的我的机器。目前,我正在试图找出如何部署该DLL使用Visual Studio的一个目标机安装项目。如何使用Visual Studio安装项目做以下的事情:

I've created a .NET assembly for COM interop and it is working well on my development machine. I'm currently trying to figure out how to deploy the DLL to a target machine using Visual Studio's "Setup Project." How can I use the VIsual Studio setup project to do the following things:

  • 注册组件(目前使用 regasm )。
    • 的组件需要被成功注册<打击>的类型库(.tlb)需要被成功注册
    • <一个href="http://stackoverflow.com/questions/239465/how-to-register-a-net-ccw-with-regasm-from-a-visual-studio-2008-setup-project/1883517#1883517">This答案表明赞成定制code报废 regasm 。我这是一个好主意吗?如果是的话,请问如何code得到包含在安装项目?
    • <一个href="http://stackoverflow.com/questions/12807/how-to-register-com-from-vs-setup-project/14604#14604">This回答建议使用 regasm / REGFILE 命令,然后使用导入工具在注册表中安装项目。将这项工作?
    • Register the assembly (currently using regasm).
      • The assembly needs to be registered successfully and the type library (.tlb) needs to be registered successfully.
      • This answer suggests scrapping regasm in favor of custom code. I this is a good idea? If so, how does this code get included in the setup project?
      • This answer suggests using the /regfile command of regasm and then using the import tool on the Registry in the Setup Project. Will this work?
      • 我在知道了全局程序集缓存文件夹的目标计算机上的文件系统。有没有什么特别的,我需要做的,包括装配在安装项目?

      任何其他建议或疑问将是非常美联社preciated。

      Any other advice or concerns would be much appreciated.

      推荐答案

      的Gacutil.exe将无法使用在目标机器上。不是一个问题,微星能够把工作做好。右键单击文件系统上的目标计算机,添加,GAC。用鼠标右键单击添加的文件夹,添加,项目输出。这保证了装配GAC-ED。

      Gacutil.exe won't be available on the target machine. Not a problem, MSI can get the job done. Right-click "File System on Target Machine", Add, GAC. Right-click that added folder, Add, Project Output. That ensures the assembly is gac-ed.

      它也可以注册程序集状Regasm.exe一样。项目输出引用的注册属性设置为vsdrpCOM。

      It can also register the assembly like Regasm.exe does. Set the Register property of the project output reference to vsdrpCOM.

      这篇关于使用Visual Studio安装项目以自动注册和GAC一个COM互操作DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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