dotnet run always prints info/compilation stuff to stdout; it shouldn't
See original GitHub issueSteps to reproduce
do dotnet new
and dotnet restore
and dotnet build
and dotnet run > output.txt
Expected behavior
It should create a file output.txt
with the contents Hello World!
Actual behavior
The actual contents of the output.txt
file are
Project t (.NETStandard,Version=v1.5) was previously compiled. Skipping compilation.
Hello World!
Rationale
I am writing a text-processing utility, similar to grep/sed/awk. It’s obviously crucial that my utility can emit its output directly to stdout without this banner getting in the way.
Environment data
dotnet --version
output: 1.0.0-beta-002133
Issue Analytics
- State:
- Created 7 years ago
- Reactions:12
- Comments:15 (7 by maintainers)
Top Results From Across the Web
dotnet run always prints info/compilation stuff to stdout; it ...
It should create a file output.txt with the contents Hello World! Actual behavior. The actual contents of the output.txt file are. Project t ......
Read more >dotnet run command - .NET CLI
The dotnet run command provides a convenient option to run your application from the source code with one command.
Read more >Making curl send errors to stderr and everything else ...
Try this: # No error messages because it succeeds. curl http://www.shikadi.net/ --fail --silent --show-error # This prints an error message ...
Read more >Windows how to redirect file parameter to stdout? ...
We run build with Unity, in batch mode: Unity.exe -batchmode -projectPath C:\***\Application -logFile -buildWebPlayer web -quit . Without ...
Read more >Don't let ASP.NET Core Console Logging Slow your App down
NET Core 2.x Console logging is very, very slow when it is set to Information or worse Debug . The default ASP.NET Core...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I dislike the
dotnet run --no-build
option because I always think the default should do the most appropriate thing for the most users.In this case, if a user calls
dotnet run
with no options, they don’t care whether the project needs to be recompiled or not, they asked the project to be run, so they should only seerun
’s output.But of course, if the build fails and the project couldn’t be run, then the user does care about those errors, because the project was not able to be run.
maybe it should only print out the “previously compiled” message on
--verbose
runs.It would work something like this:
dotnet build
is called directly, print out the messages as usual.dotnet run
is called directly, it callsdotnet build
, it should pass in a--verbosity minimal
parameter, so build only prints out absolutely necessary things (like build failures)dotnet --verbose run
is called directly, everybody prints out everything.