3

I'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 not registered I receive an error selecting the dll file "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."
We would like to keep the DLL not registered, so that we have less configuration needed on other development machines and on the development environments.
Is it too much to ask?
Thanks!

4

4 回答 4

3

you need to register dll. you can set registration in your setup project or create a batch file for all these type of processes. Note: Don't forget to unregister dll on uninstallation.

于 2009-12-08T10:25:47.803 回答
0

您需要注册 dll,否则它将无法找到类型库。
之后添加 dll 作为对您项目的引用将创建 interop.XXXXmethod.dll 程序集。

于 2009-12-08T10:30:14.930 回答
0

您需要注册 COM 服务器,期间。您可以采取一些措施来自动化该过程,并在不需要时取消注册 COM 服务器。

这同样适用于日常构建。如果在构建过程中构建 COM 服务器和基于 .NET 的客户端,则必须在构建客户端之前注册服务器。并且您最好在构建客户端后立即取消注册。将这些步骤添加到构建序列中根本不是问题。

于 2009-12-08T10:32:34.410 回答
0

您也许可以使用免费注册 Com

于 2009-12-08T10:32:34.817 回答