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 should no suppress console output

See original GitHub issue

Steps to reproduce

I’m using dotnet watch run on my Vue.js SPA project I built using the ASP.NET Core SPA templates. I added TS-Lint support to webpack via the tslint-loader. My csproj contains the following code (default to the SPA template) that runs webpack before a build:

<Target Name="DebugRunWebpack" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' ">
    <!-- Ensure Node.js is installed -->
    <Exec Command="node --version" ContinueOnError="true">
      <Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
    </Exec>
    <Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />

    <!-- In development, the dist files won't exist on the first run or when cloning to
         a different machine, so rebuild them if not already present. -->
    <Message Importance="high" Text="Performing first-run Webpack build..." />
    <Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js" />
    <Exec Command="node node_modules/webpack/bin/webpack.js" />
  </Target>

Using dotnet run or more importantly dotnet watch run in my case, supresses all console output, so I can’t see any TS-Lint errors.

Expected behavior

dotnet run should not suppress console output or at least have an option to no do so.

Actual behavior

dotnet run supresses console output.

Environment data

dotnet --info output:

.NET Command Line Tools (2.0.2)

Product Information:
 Version:            2.0.2
 Commit SHA-1 hash:  a04b4bf512

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15063
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.0.2\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
peterhuenecommented, Nov 28, 2017

@RehanSaeed Thanks for reporting this issue! With the fix currently in dotnet/cli#8100, you should be able to pass the -v:<verbosity> option to enable the restore/build output.

0reactions
livarcocccommented, Nov 28, 2017

@peterhuene you are already adding this in your PR for --no-build meaning no implicit restore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Suppress Build Output When Running `dotnet run`
Is it possible to suppress the build warnings which are output when dotnet run causes a build to occur, e.g. after a code...
Read more >
dotnet run command - .NET CLI
The dotnet run command provides a convenient option to run your application ... To disable implicit restore, use the --no-restore option.
Read more >
Disable logging of dotnet core console output
This seems to prevent the application from writing to the daemon and syslog logs. My question is - is this advisable and are...
Read more >
Suppressing the startup and shutdown messages in ASP. ...
In this post, I show how you can disable the startup message shown in the console when you run an ASP.NET Core application....
Read more >
10 commands you don't want to be without in .Net Core
[object Object]
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