dotnet/runtime

Add an editorconfig option to supress LibraryImport suggestion for blittable PInvokes

Aberta

#111.593 aberto em 19 de jan. de 2025

 (6 comentários) (3 reações) (0 responsável)C# (5.445 forks)batch import
area-Interop-coreclrcode-analyzerhelp wanted

Métricas do repositório

Stars
 (17.886 estrelas)
Métricas de merge de PR
 (Mesclagem média 12d 11h) (661 fundiu PRs em 30d)

Description

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

Guia do colaborador