Search code examples
.netinteropregistrationregasm

How to unregister my .net assembly when it's no longer in the same location?


I have a dll that's registered for com interop, so under HKLM\Software\Classes\CLSID[my guid]\InprocServer32[my version no]\Codebase it has the path of the registered dll. However, I've rearranged my folder structure so that path is no longer correct. Is there a way of unregistering that dll without putting it back, then unregistering, then removing the file again?

And what if I don't have that dll any more, or only have one with a different version number?


Solution

  • Different version numbers (generally) do not matter. As long as the newer DLL contains all the GUIDs which appear in the older version, it will be unregistered properly (using the new one with regasm,exe). And of course, reregistering the assembly for COM interop will properly relocate necessary registry keys.