Skip to content

Marshal.GetObjectForNativeVariant is obsoleted with no workaround provided #28564

@jbartlau

Description

@jbartlau

When using Marshal.GetObjectForNativeVariant, this gives a warning:

warning CS0618: 'Marshal.GetObjectForNativeVariant(IntPtr)' is obsolete: 'GetObjectForNativeVariant(IntPtr) may be unavailable in future releases.'

We heavily rely on being able to interop with variants (which actually works just fine in Core 3 Preview 2). Would be happy to move to a different technique, however the warning doesn't contain a suggested way to do things right. Does the obsoletion make sense? What's the future proof way to marshal variants then?

Metadata

Metadata

Labels

area-System.Runtime.InteropServicesquestionAnswer questions and provide assistance, not an issue with source code or documentation.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions