运行“dotnet run”时抑制构建输出

TKF*_*TKF 6 .net c# build

是否可以抑制在dotnet run导致构建发生时(例如代码更改后)输出的构建警告?

$ dotnet run --verbosity quiet

/../MyProgram.cs(6,21): warning CS8618: Non-nullable property
    'MyProperty' must contain a non-null value when exiting
    constructor. Consider declaring the property as nullable.

<My Program Output>
Run Code Online (Sandbox Code Playgroud)

这是痛苦的,因为在开发过程中我会将程序输出传输到另一个工具中,并且构建警告输出会破坏该工具的解析。我不想禁用任何特定的警告;我想简单地从 的输出中忽略它们dotnet run

TKF*_*TKF 11

$ dotnet run --property WarningLevel=0
Run Code Online (Sandbox Code Playgroud)