dotnet/runtime

Add an editorconfig option to supress LibraryImport suggestion for blittable PInvokes

Open

#111.593 aperta il 19 gen 2025

Vedi su GitHub
 (6 commenti) (3 reazioni) (0 assegnatari)C# (5445 fork)batch import
area-Interop-coreclrcode-analyzerhelp wanted

Metriche repository

Star
 (17.886 star)
Metriche merge PR
 (Merge medio 12g 11h) (661 PR mergiate in 30 g)

Descrizione

The current LibraryImport analyzer always suggests to convert to it from DllImport, even when it's not necessary due to the signature being blittable. This is especially annoying when multitargeting with older TFMs without LibraryImport. As discussed on Discord, there should be an option to opt out of this with an editorconfig switch.

cc @jkoritzinsky @tannergooding

Guida contributor