Skip to content

Should Roslyn or SDK provide a mechanism to enable/disable some/all source generators? #55518

@ericstj

Description

@ericstj

User's might need to disable a source generator for some reason (like a performance or compatibility issue). In general we should fix those and it shouldn't be a very common occurrence, however we may want to have a mechanism available as a mitigation.

In writing up the docs for dotnet/docs#24896 (comment) we came to the conclusion that allowing users to toggle all framework source generators/analyzers wasn't particularly useful, and might even be dangerous.

dotnet/sdk#1212 means that analyzers/generators from packages can't easily be excluded either.

Should we have targets in the SDK/MSBuild that formalize a file-based exclusion mechanism? Should roslyn support some exclusion mechanism itself (through compiler parameters, editorconfig, etc)?

cc @jaredpar @chsienki @terrajobst @KathleenDollard @jmarolf

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions