Question

As part of a build process, several dll's and tlb's are registered to COM via regsvr32. There's a step at the end of the build which unregisters that same list of dll's and tlb's. However, that step does not run if the build fails early.

The problem is that subsequent builds do not always use the same build path and project builds fail due to them looking for registered dll's in the wrong place (since they're still registered in COM from a previous failed build).

The simple solution is to ensure that the unregister script runs at the end of every build regardless of fail or pass, however this is not so easy with our build tool. Is there another way to unregister dll's/tlb's without their original source file present in it's registered path?

Was it helpful?

Solution

You don't need to call unregister with the same dll as you registered with, you just need to know that the dll you are unregistering removes the same classes in its DllUnregisterServer method as the lost dll file did in its DllRegisterServer method.

With this in mind, you should be able to use the dll at the new path to unregister the one at the old path.

Maybe try changing your build process to unregister the dlls before registering them, it will clean up the dangling references to the lost dlls before registering the correct ones and you should be good to go.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top