sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Make dotnet build write warnings to stdout not stderr

Open jchannon opened this issue 10 years ago • 4 comments

Steps to reproduce

When dotnet build is executed and compiler warnings are found these are written to stderr. I think these should be written to stdout.

Expected behavior

Compiler warnings should be in stdout

Actual behavior

Compiler warnings appear in stderr

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview1-002702)

Product Information:
 Version:     1.0.0-preview1-002702
 Commit Sha:  6cde21225e

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.11
 OS Platform: Darwin
 RID:         osx.10.11-x64

jchannon avatar Jun 23 '16 08:06 jchannon

One thing to consider is if "Treat warnings as errors" is on then it should go to stderr else default should be stdout

jchannon avatar Jul 05 '16 13:07 jchannon

I also encountered this when I found that "dotnet build" warnings in a TeamCity log show up in red.

hermot avatar Oct 11 '16 11:10 hermot

I just tried this with preview3. Warnings are being redirected to std out.

TheRealPiotrP avatar Nov 12 '16 21:11 TheRealPiotrP

Warnings in stderr for 1.0.0-preview2-1-003177 (latest version), and it stopes TeamCity to continue.

$stdErrLog = "D:\stderr.log"
$stdOutLog = "D:\stdout.log"
cd D:\WebApp
Start-Process -File "D:\WebApp\build.bat" -RedirectStandardOutput $stdOutLog -RedirectStandardError $stdErrLog -wait

build.bat is dotnet build

sm-g avatar Jan 11 '17 13:01 sm-g