Mark TypeBuilder.DefinePInvokeMethod as RequiresUnreferencedCode #45703
Labels
area-System.Reflection.Emit
linkable-framework
Issues associated with delivering a linker friendly framework
Milestone
#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.
The text was updated successfully, but these errors were encountered: