Issue Description
If a mistake is made in passing arguments to dotnet msbuild, no output related to the error is printed to the terminal. I ran into this in an application where MSBuild is invoked as an external process via the Process class and the output is redirected to a stream to be consumed in the calling application.
The only way to get the actual reason for the failure appears to be via a binary log file with -bl.

This makes diagnosing issues, particularly in CI environments, much more difficult to get to the bottom of than it should be.
Steps to Reproduce
- Open a terminal in a directory containing an MSBuild project/solution.
- Run a command such as the following where an argument is invalid:
dotnet msbuild /t:Restore "/p:foo =bar" -v:diag
Expected Behavior
The error is printed to the terminal, in this case:
MSBUILD error MSB4177: Invalid property. The name "foo " contains an invalid character " ".
Actual Behavior
Only the command passed to MSBuild is rendered to the console
❯ dotnet msbuild /t:Restore "/p:foo =bar" -v:diag
C:\Program Files\dotnet\sdk\9.0.200-preview.0.24575.35\MSBuild.dll -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\9.0.200-preview.0.24575.35\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\9.0.200-preview.0.24575.35\dotnet.dll -maxcpucount -tlp:default=auto -verbosity:m -v:diag /p:foo =bar /t:Restore .\DotNetOutdated.csproj
❯ $LASTEXITCODE
1
Analysis
No response
Versions & Configurations
- dotnet --version:
9.0.200-preview.0.24575.35
- dotnet msbuild --version:
17.13.0.56904
Issue Description
If a mistake is made in passing arguments to
dotnet msbuild, no output related to the error is printed to the terminal. I ran into this in an application where MSBuild is invoked as an external process via theProcessclass and the output is redirected to a stream to be consumed in the calling application.The only way to get the actual reason for the failure appears to be via a binary log file with
-bl.This makes diagnosing issues, particularly in CI environments, much more difficult to get to the bottom of than it should be.
Steps to Reproduce
dotnet msbuild /t:Restore "/p:foo =bar" -v:diagExpected Behavior
The error is printed to the terminal, in this case:
Actual Behavior
Only the command passed to MSBuild is rendered to the console
Analysis
No response
Versions & Configurations
9.0.200-preview.0.24575.3517.13.0.56904