Skip to content

Source Generator projects don't need to be included in other library's sln files #58879

@eerhardt

Description

@eerhardt

Any library that references System.Text.Json is getting the Json Source Generator project in their .sln file:

Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Text.Json.SourceGeneration", "..\System.Text.Json\gen\System.Text.Json.SourceGeneration.csproj", "{160C3D6B-D90A-40B1-A695-81DB79EB24C4}"
EndProject

Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Text.Json.SourceGeneration", "..\System.Text.Json\gen\System.Text.Json.SourceGeneration.csproj", "{6699E51A-8DC5-4DBA-A06B-B4A04144E4FA}"
EndProject

Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Text.Json.SourceGeneration", "..\System.Text.Json\gen\System.Text.Json.SourceGeneration.csproj", "{D120D5A7-69D9-44A2-B7F7-EE0E48CC0238}"
EndProject

These are unnecessary, bloating the .sln file. With #58446, there are now 2 .csprojs for each source generator - each targeting a different version of Roslyn. Which will make it even worse.

We only really need the Source Generator projects in the .sln files of the libraries that build source generators: Json and Logging.Abstractions.

cc @ViktorHofer

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions