Building .NET COMInterop project without first registering the COM service

南笙酒味 提交于 2019-12-04 21:43:18

You need to create interop assembly using tlbimp.exe tool. And add reference to this assembly in your project instead of typelib. In this case building will not require registered com server.

If you do not want to ship yet another assembly, you can extract interface description from generated interop assembly using Reflector and include them into project as source files.

Solved this by adding a -regtypelib command to the COM service, which calls the AtlRegisterTypeLib function but does not register the service. Suboptimal because it will leave registery entries on the build server, but quick and it works.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!