question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet run always prints info/compilation stuff to stdout; it shouldn't

See original GitHub issue

Steps 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:closed
  • Created 7 years ago
  • Reactions:12
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
eerhardtcommented, Jun 9, 2016

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 see run’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.

1reaction
eerhardtcommented, Jun 9, 2016

maybe it should only print out the “previously compiled” message on --verbose runs.

It would work something like this:

  • When dotnet build is called directly, print out the messages as usual.
  • When dotnet run is called directly, it calls dotnet build, it should pass in a --verbosity minimal parameter, so build only prints out absolutely necessary things (like build failures)
  • When dotnet --verbose run is called directly, everybody prints out everything.
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found