使用Visual Studio安装项目以自动注册和GAC一个COM互操作DLL操作、项目、Studio、Visual

2023-09-02 01:35:23 作者:失去你没什么大不了

我创建了一个.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)需要被成功注册。 This答案表明赞成定制code报废 regasm 。我这是一个好主意吗?如果是的话,请问如何code得到包含在安装项目? 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.

 
精彩推荐
图片推荐