Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

COM-Interop: Change .NET Framework Version from 2.0 to 4.0 - Should I change the Guids also?

I like to migrate a COM-Class from 2.0 to 4.0. Would you recommend also to generate new guids for the classes and a different ProgId?

The old Class would not be used anymore. I know I have to re-register the Class, for the new Path of the mscorlib.

MS-Access create an instance auf my COM-Server Class with CreateObject and my COM-Object load some other classes with DI (dot.net 2.0 and in future 4.0)

like image 450
Summer-Time Avatar asked Feb 26 '23 01:02

Summer-Time


1 Answers

You only have to use new GUIDs when the interface definition changes. When you keep them the same, your new COM server will replace the existing one. And client code that uses it doesn't have to be recompiled. When you do change them then they can live side-by-side but client code has to explicitly be recompiled to use the new one.

Note that the in-process side-by-side CLR version support in .NET 4.0 is relevant here. Your COM server can be used in a program that binds the .NET 4.0 CLR, even if the COM server still binds the 2.0 CLR. Technically you don't have to update it.

like image 193
Hans Passant Avatar answered Mar 19 '23 03:03

Hans Passant