Apps using MSBuildWorkspace should have some way to pick the appropriate version to match their SDK
- Dominant language
- C#
- Stars
- 20.7k
- Forks
- 4.3k
- PR merge metrics
- PR metrics pending
Description
This issue tracks the underlying problem that was revealed in [this bug report](https://github.com/dotnet/roslyn/issues/77255). If you write a console app that uses MSBuild, you add a NuGet reference to Roslyn. This isn't obvious that this happens, but it means you are setting an implicit version of Roslyn that impacts what analyzers and generators can load. In that bug, this meant things worked just fine, until their repo got upgraded to a newer SDK, which brought along generators targeting a new version of Roslyn. Suddenly, they have to update their package's references to Roslyn.
The lack of diagnosability there was a problem, but we should still have some way for an application using MSBuildWorkspace to add a package reference to the Roslyn that matches their SDK, that way you can be assured that app can load your other projects just fine.
Contributor guide
Research direction
Start with linked bug report #77255 and the MSBuildWorkspace package-reference behavior described here. Investigate how an application could select Roslyn packages matching its SDK, then define how that choice should work when projects use newer analyzers or generators.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system, developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100