8000 Stop compiler warnings being written to stdout · Issue #657 · dotnet-script/dotnet-script · GitHub
[go: up one dir, main page]

Skip to content

Stop compiler warnings being written to stdout #657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mcintyre321 opened this issue Feb 2, 2022 · 0 comments · Fixed by #686
Closed

Stop compiler warnings being written to stdout #657

mcintyre321 opened this issue Feb 2, 2022 · 0 comments · Fixed by #686

Comments

@mcintyre321
Copy link

I've written a dotnet script which I'm using as part of a unix pipe chain.

A problem I'm finding is that if I leave some non-breaking code in the csx file, that throws a warning, e.g.

public async Task Foo()
{
    //no code in this method currently uses await, but I can't face refactoring all the 
    //task code out of existence as I'm probably going to use some await code in a minute
}

then

warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

will be written to StdOut, messing up my unix piping.

is there a way to suppress these warnings, or have them written to StdErr (which is ignored when piping)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant
0