c# - dotnet build 命令忽略 .editorconfig

标签 c# .net-core editorconfig

系统

  • Visual Studio 2019 16.4.0
  • .NET 核心 2.2
  • Windows 10

场景

NuGet 包 Microsoft.CodeAnalysis.FxCopAnalyzers Visual Studio 可以对托管代码执行代码分析。

每个诊断或规则都有一个默认的严重性和抑制状态,可以为您的项目覆盖这些状态。

configure rules有多种模式

在构建或编辑它时,我使用了 .editorconfig 模式和 Visual Studio IDE。

不幸的是,当我从命令行构建项目时

dotnet build

.editoconfig 被忽略。

最佳答案

根据 this discussion on GitHub ,看起来语言规则/分析功能目前不会触发运行命令行构建的失败。

如果您希望构建工具或 CI 环境识别 .editorconfig规则集,您需要确保运行 Visual Studio 2019 16.3 或更高版本 as mentioned here .

关于c# - dotnet build 命令忽略 .editorconfig,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59272825/

相关文章:

c# - 从自定义模型 Binder 返回 403

visual-studio-code - (为什么)我会在项目中同时使用 .editorconfig 文件和 VS 代码工作区设置?

C# MongoDB 驱动程序 [2.7.0] CountDocumentAsync 意外的 native 查询

c# - 在具有 EF core 的 Nuget 类库上使用 .NET 4.6.1 进行编译时出错

c# - Xamarin.Android - 如何实现通用图像加载器库中使用的回调

angular - Docker 和身份服务器 4,api, Angular : Cannot assign requested address

linux - 找不到 editorconfig-core-c 的 Makefile

editorconfig - editorconfig 中的 [Makefile] 和 "end_of_line "是什么?

c# - Entity Framework : The provider did not return a providermanifest instance

c# - 为什么具有可为空值的结构的 HashSet 非常慢?