Runtime: Several COM interop features marked as obsolete

Created on 16 Aug 2019  路  6Comments  路  Source: dotnet/runtime

Referencing this issue

The documentations for .NET Framework for various methods / objects defined within System.Runtime.InteropServices has been marked with Obsolete, mainly with comment that it may be unavailable in future releases. I'm including few samples:

ICustomQueryInterface
DispatchWrapper
Marshal.GetObjectForNativeVariant

There are several more but the concern here is that they are marked as obsolete and there is no indication that there will be a substitute. Because we depend on those, it worries me that they are marked as obsolete. Given that .NET Core has made compatibility a priority, I would suggest that marking them obsolete is premature until there's an actual suitable replacement for us to use.

area-System.Runtime.InteropServices

All 6 comments

@bclothier Was in the middle of creating this. Thanks!

As a matter of fact as things currently are you absolutely need ICustomQueryInterface to customize System.Windows.Forms.WebBrowserSiteBase because the COM interop normally exposes the first implementation of an interface so it will ignore any attempt at re-implementing it in a derived class.

Also ICustomAdapter from System.Runtime.InteropServices

There are additional types that need to be fixed:

ComEventInterfaceAttribute and the two enum properties here https://github.com/dotnet/runtime/issues/720

@clairernovotny The ComEventInterfaceAttribute is no longer marked Obsolete. What version of dotnet is being used?

https://github.com/dotnet/runtime/blob/1c18e8c038bbf2cca8297922519ebe05bb003f3c/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs#L219-L226

I'm using 5.0.100-preview.4.20258.7

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chunseoklee picture chunseoklee  路  3Comments

bencz picture bencz  路  3Comments

GitAntoinee picture GitAntoinee  路  3Comments

noahfalk picture noahfalk  路  3Comments

v0l picture v0l  路  3Comments