我'm trying to reference a COM dll in visual studio by using the Browse tab and selecting the DLL. I noticed that if the DLL is registered on the system with regsvr32 I can reference it, but if it' s未注册我收到错误选择dll文件"A reference to 'file.DLL' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component."
我们希望保持DLL未注册,以便我们在其他开发机器和开发环境中需要的配置更少 .
要问太多了吗?
谢谢!
4 回答
你需要注册DLL . 您可以在安装项目中设置注册,也可以为所有这些类型的进程创建批处理文件 . 注意:不要忘记在卸载时取消注册dll .
您需要注册dll,否则它将无法找到类型库 .
之后添加dll作为对项目的引用将创建interop.XXXXmethod.dll程序集 .
您需要注册COM服务器,期间 . 您可以采取一些措施来自动化该过程,并在不需要时取消注册COM服务器 .
这同样适用于每日构建 . 如果在构建期间构建COM服务器和基于.NET的客户端,则必须在构建客户端之前注册服务器 . 最好在构建客户端后立即取消注册 . 将这些步骤添加到构建序列根本不是问题 .
你或许可以使用Registration Free Com