【发布时间】:2021-06-02 20:28:02
【问题描述】:
我为我的项目设置了一个 editorconfig 文件,它在我的 IDE 中完美运行,并引发了正确的警告。示例:IDE0052(未使用的变量)和 IDE0055(格式错误)。
但是,我想在构建期间将来自 editorconfig 的警告作为错误强制执行,以使其失败。有没有办法做到这一点?在 csproj 中将属性“MSBuildTreatWarningsAsErrors”或“TreatWarningsAsErrors”设置为 true 没有做任何事情。
谢谢!
【问题讨论】:
标签: c# msbuild coding-style editorconfig unused-variables