I have a .NET DLL (this happens to be written in C ++ / CLI). I want to open parts of it through COM. I do this and register it with "regasm my.dll / codebase". So far, so good. But then I change some things, and the build version number changes, and I move the dll to another folder. I will register it again and look at my COM object in the OLE / COM Viewer. I see something like this
InprocServer32 [Codebase] = file: // c: //foo/bar/my.dll
7.0.0.0 [Class] = My.Blah.Class
7.0.0.0 [Assembly] = Sync, Version = 7.0.0.0, Culture = neutral, PublicKeyToken = 1dd19234234
7.0.0.0 [RuntimeVersion] = v2.0.50727
7.0.0.0 [CodeBase] = file: // c: /dooby/do/my.dll
7.0.0.27397 [Class] = My.Blah.Class
7.0.0.27397 [Assembly] = Sync, Version = 7.0.0.27397, Culture = neutral, PublicKeyToken = 1dd19234234
7.0.0.27397 [RuntimeVersion] = v2.0.50727
7.0.0.27397 [CodeBase] = file: // c: //foo/bar/my.dll
Questions about multiple versions:
Therefore, I think the last COM object that was registered wins. It doesnβt matter if my old 7.0.0.0 COM object was registered with me, 7.0.0.27397 is the one that will be created when I create an instance of my COM object, because I registered it last. It is right?
Unfortunately, I did not support the 7.0.0.0 object. Is there any way to get rid of it? Is there a way to delete all versions of a COM object, except for entering the registry and manually hitting it?
Just out of curiosity, if I specifically wanted to instantiate a specific version of my COM object, is there a way to do this? (I use C ++ if you want to give a code example).
Is there a way that I can just tell regasm not to store the version number, because it just outshines things, and I donβt see what an advantage. If my COM object went through a major API change, I would just change the GUID and progid, right? What if I do not want to register several versions (I do not do this).
com versions regasm
mhenry1384
source share