Search code examples
comregsvr32project-reference

Do I need to register the COM dll to be able to reference it on the .NET project?


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!


Solution

  • 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.