dotnet / dotnet/roslyn

Apps using MSBuildWorkspace should have some way to pick the appropriate version to match their SDK

Open
#77,979 1 comment 0 reactions 0 assignees View on GitHub
Area-IDE
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.