即使GenerateDocumentationFile 设置为 true,IDE0005 也不会报告为构建失败

Sat*_*Roy 7 stylecop visual-studio editorconfig

如果存在未使用的用途,我希望项目的构建失败。在 csproj 中我添加了:

<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Run Code Online (Sandbox Code Playgroud)

按照https://github.com/dotnet/roslyn/issues/41640中提到的解决方案 在 .editorconfig 中我添加了:

dotnet_diagnostic.IDE0005.severity = error
Run Code Online (Sandbox Code Playgroud)

但是构建仍然没有失败。IDE 中报告错误,但构建成功。 在此输入图像描述

在此输入图像描述

有人可以让我知道我在这里缺少什么吗?我正在使用 Visual Studio 2022。