I was tasked with building a C# 4.0 application that leverages an old VB6 COM component to integrate with another old VB6 application. The component was built strictly for this integration, and is deployed by my application.
I built an installer for my C# application using Visual Studio Setup project, and added that COM component to the list of deployed files. Installer auto registers/unregisters the component beautifully.
However, the issue I have now is that after uninstalling the application on my development box I can’t debug the application without registering the COM component again by hand since the uninstall unregistered it. I’m not implying the uninstall shouldn’t unregister the COM component. I’m just trying to figure out a better way of making sure we can still build and test both the application and installer on our development boxes without this inconvenience.
P.S. I tried using a DllImport, but it never finds the entry point. From what I understand from research you can’t really use a DllImport on a COM component. I hope I didn’t miss something.
You’re pretty much doing the right thing and the installer has to unregister the COM component unless you want to encounter some really problematic effects on customers machines.
Unfortunately there isn’t much you can do apart from maybe writing a simple CMD file to re-register the COM component after you tested the installer.