IDE0005 not reported as build failure even with GenerateDocumentationFile set to true

1.2k views Asked by At

I want the build of my project to fail if there are unused usings. In csproj I have added:

<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

Following the solution mentioned in https://github.com/dotnet/roslyn/issues/41640 In .editorconfig I have added:

dotnet_diagnostic.IDE0005.severity = error

However the build still doesn't fail. The errors are reported in the IDE but the build succeeds. enter image description here

enter image description here

Could someone let me know what am I missing here? I am using visual studio 2022.

0

There are 0 answers