是否可以抑制在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)
--property:<NAME>=<VALUE>将属性传递给 MSBuild ( https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-run )WarningLevel=[0,1,2,3,4]配置要输出的警告级别,其中4是默认值并0禁用所有警告(https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings)| 归档时间: |
|
| 查看次数: |
7962 次 |
| 最近记录: |