Discussion:
.net com exposure, multiple versions
(too old to reply)
Mark
2010-04-28 18:34:01 UTC
Permalink
Hi...

We have a number of .net classes exposed as COM interop, and I've been asked
to look into versioning them so we can have multiple versions running on the
same system.

Looking at it though, the [ProgId()] attribute doesn't seem to incorporate
the concept of versioning at all. Neither does regasm.

Unlike an unmanaged COM object where you could specify the version-specific
progid and define which version a non-specific progid should go to, I don't
see analogs in .net interop.

If I build the classes with different versions, and regasm both of them I
end up with 1 non-version specific progid. And when I find the InProcSvr32
key, I see sub-keys for both versions.

But trying to instantiate the object always just gets the newest one.

How does one support multiple versions of .Net COM interop?

Thanks
Mark
Jialiang Ge [MSFT]
2010-05-03 03:24:17 UTC
Permalink
Hello Mark

If you also want to activate the older ones, you may have to assign
different CLSID to the different versions of the component, then attach
versioned progId to them through the ProgId attribute. For example,

Prog ID CLSID
MyComponent.1 {00030906-0000-0000-C000-000012340046}
MyComponent.2 {00020906-0000-0000-C000-000056780046}

This breaks the binary compatibility. Are you sure that this is what you
want to do?

Regards,
Jialiang Ge (***@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================

Continue reading on narkive:
Loading...