dotnet / dotnet/roslyn

MSbuildProjectLoader.LoadProjectInfoAsync should allow skipping unrecognized projects

Open
#75,956 0 comments 1 reaction 0 assignees View on GitHub
Area-IDE
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

`LoadSolutionInfoAsync` uses `SkipUnrecognizedProjects` property to determine whether to throw on unrecognized project.
`LoadProjectInfoAsync` uses that property as well, but only for discovered projects. It is hardcoded to throw exception when requested projects are unrecognized.

The caller needs to handle unrecognized projects in two ways:
- hook up WorkspaceFailed
- catch a general `InvalidOperationException` around the entire load call

It'd be better if `LoadProjectInfoAsync` honored `SkipUnrecognizedProjects` for all projects. IF the requested project is not recognized it'd return empty array.

Related: https://github.com/dotnet/roslyn/issues/75170

Contributor guide

Open the contributing guide

Research direction

Start by comparing LoadProjectInfoAsync with LoadSolutionInfoAsync, focusing on how each uses SkipUnrecognizedProjects. Trace the requested-project path and the existing exception behavior. Done means unrecognized requested projects are skipped and produce an empty array when the property is enabled, with coverage for both enabled and disabled behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.