Add context info to exception when MSBuild is not found
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
Is your feature request related to a problem? Please describe.
The current error message and exception thrown when MSBuild is not found says:
Could not find a compatible version of MSBuild. Check that you have a valid installation with the required workloads, or go to www.visualstudio.com/downloads to install a new one.
System.InvalidOperationException: Could not find a MSBuild installation (expected 16.0 or later)
Describe the solution you'd like
We should enrich the exception with info about any versions that were available but couldn't be used and any other context useful for debugging this - users who see the exception and have VS installed can be left confused as to what is the problem.
Related to #756
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the MSBuild discovery code and the exception that reports when no compatible installation is found; review related issue #756 for context. Check how available but unusable versions are identified, and consider the work done when the exception includes those versions and other useful diagnostic context.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100