I am trying to have two versions of the same dll running on the same machine, as I described in my last question here
. As you can see from that question, I accepted the first answer, which I thought had solved my problem. But as it turned out, I hadn’t tested it out enough. The ‘If’ statement did change the GUID for release, but it didn’t handle a different factor.
Visual Studio always unregisters the old version of your dll before registering the new one, and it seems to keep track of GUID changes, at least in a limited scope. For example, if you have an assembly that is registered for COM interop, and you change the GUID, Visual Studio knows to unregister the old GUID instead of trying to unregister the new one which obviously hasn’t been registered yet.
This creates a problem, since I want both versions of the dll to be registered at the same time. I want to compile for debug, then compile for release (while keeping the debug version registered and working) and then go back to compiling for debug (while keeping the release version working). So I need Visual Studio not to unregister the old GUID when the ‘If’ statement changes it.