Use dotnet-scope to diagnose .NET build errors. When a dotnet build fails, pipe the output to `dotnet-scope diagnose` to get enriched diagnostics with source context, documentation links, and suggestions for common errors like typos in method names.
A diagnostic instrument for .NET source code. Use this tool when working with C# projects that have build errors or when you need to understand what external APIs a codebase uses.
dotnet tool install -g dotnet-scope
Pipe build output to get enriched diagnostics:
dotnet build 2>&1 | dotnet-scope diagnose
This provides:
dotnet-scope symbols Program.cs:42 -c 2
Shows symbols in scope at a specific line with classification (UserDefined, Framework, External, Undefined).
dotnet-scope scan src/ --packages
Lists which NuGet package APIs are used in the codebase.
dotnet-scope docs src/
Shows documentation for packages used, with follow-up commands for deeper investigation.
When a build fails:
dotnet build 2>&1 | dotnet-scope diagnosedotnet-scope includes documentation for ~3,700 diagnostic codes: