Skip to content

Add DiagnosticSuppressor for IDE0044 on fields with [Import]/[ImportMany] attribute #705

@tmat

Description

@tmat

IDE0044 ("Make field readonly") produces false positives for fields with MEF [Import]/[ImportMany] attributes, since they're assigned at runtime via reflection. (See dotnet/roslyn#36266 (dotnet/roslyn#36266))

Proposal: Add a DiagnosticSuppressor to this package that suppresses IDE0044 for such fields. This is the intended Roslyn mechanism for cross-package suppression and fits naturally here since the package already ships MEF-specific analyzers (VSMEF001–012).

Impact: Without this, projects using MEF field injection with IDE0044 enabled either accumulate suppression pragmas or risk runtime failures if the suggestion is auto-applied.

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions