Skip to content

Mark TypeBuilder.DefinePInvokeMethod as RequiresUnreferencedCode #45703

@MichalStrehovsky

Description

@MichalStrehovsky

#45633 (comment)

If linker didn't see the p/invoke, it would not have done the necessary work to ensure the generated marshalling code for the p/invoke can work (constructors might be missing for types used in out positions of the signature, the p/invoke might introduce COM into the process etc.).

We should put RequiresUnreferencedCodeAttribute on all overloads in the ref assembly and all the implementations.

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions