dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.63k stars 4.57k forks source link

Implicit SourceGenerator: System.Text.Json.SourceGeneration (net 6.0) #59284

Closed bernd5 closed 2 years ago

bernd5 commented 2 years ago

For simple Apps which have no explicit SourceGenerator and do nothing with JSON I would like to load/analyze projects as fast as possible. In roslyn workspaces is a check for sourcegenerators: https://github.com/dotnet/roslyn/blob/60a431bf454e78ae3cefc1930d356a72eaaba20c/src/Workspaces/Core/Portable/Workspace/Solution/SolutionState.CompilationTracker.cs#L1078 which is now practically always false - therefore it must be compiled all the time.

Why is it included even if the project does not refer to something related to JSON (like a hello-world app)? Please remove this implicit source generator for those projects.

ghost commented 2 years ago

Tagging subscribers to this area: @eiriktsarpalis, @layomia See info in area-owners.md if you want to be subscribed.

Issue Details
For simple Apps which have no explicit SourceGenerator and do nothing with JSON I would like to load/analyze projects as fast as possible. In roslyn workspaces is a check for sourcegenerators: https://github.com/dotnet/roslyn/blob/60a431bf454e78ae3cefc1930d356a72eaaba20c/src/Workspaces/Core/Portable/Workspace/Solution/SolutionState.CompilationTracker.cs#L1078 which is now practically always false - therefore it must be compiled all the time. Why is it included even if the project does not refer to something related to JSON (like a hello-world app)? Please remove this implicit source generator for those projects.
Author: bernd5
Assignees: -
Labels: `area-System.Text.Json`, `untriaged`
Milestone: -
eiriktsarpalis commented 2 years ago

cc @layomia @eerhardt

layomia commented 2 years ago

Dup of https://github.com/dotnet/roslyn/issues/55518 - I believe we are striving to address this for net6.0 cc @eerhardt @ericstj @jaredpar