In RoslynAnalyzers, change Microsoft.CodeAnalysis package references to project references
All of the projects in the src/RoslynAnalyzers directory use PackageReference to reference Microsoft.CodeAnalysis.* when they should really be using ProjectReference since these projects are now in the same repo.
Example:
https://github.com/dotnet/roslyn/blob/c3c7ad6a866dd0b857ad14ce683987c39d2b8fe0/src/RoslynAnalyzers/Microsoft.CodeAnalysis.AnalyzerUtilities/Microsoft.CodeAnalysis.AnalyzerUtilities.csproj#L21
This is needed to correctly resolve an issue with source-build prebuilts: https://github.com/dotnet/dotnet/pull/400#issuecomment-2886950873
/cc @JoeRobich
they should really be using ProjectReference since these projects are now in the same repo.
Specifically for source build. For our published packages we still want to reference older packages in order to not tie their usage to the latest Roslyn release.
This issue needs to be fixed before RC1. For source build, we encountered an problem that stems from this issue: https://github.com/dotnet/dotnet/pull/1187#issuecomment-2980464691. It requires us to reboostrap to a newer version of the SDK out of band from a release. This is something that we cannot do once RC1 ships. So in order to avoid that, we need this issue fixed by then.
@JoeRobich - Is there a timeline for fixing this? It really must be done before RC1.
@mthalman Is this PR along the lines of what you were thinking? Is there a way to do a test run with these changes?
Yes. I'm guessing that there are reasons why this can't be updated to use project references regardless of whether its source build or not?
You can test this by creating a draft PR at https://github.com/dotnet/dotnet, applying your changes to src/roslyn.
I'm guessing that there are reasons why this can't be updated to use project references regardless of whether its source build or not?
Yes, as these packages also ship via nuget.org, building with project references means our users cannot use these packages with older Roslyn compilers (VS/SDK releases).
You can test this by creating a draft PR at https://github.com/dotnet/dotnet, applying your changes to src/roslyn.
It would be neat if there were a GH action that would simplify that to a slash command.
You can test this by creating a draft PR at https://github.com/dotnet/dotnet, applying your changes to src/roslyn.
It would be neat if there were a GH action that would simplify that to a slash command.
We're working on getting pipelines available that will allow you to trigger a VMR pipeline run directly from your roslyn repo PR.