lonix
lonix

Reputation: 20591

Disable Roslyn code analysers on a specific project

I want to add custom assertions to XUnit's Assert, so:

That works.

However because that is imported as source, I get hundreds of code analyzer warnings on every build in the cli, and my vscode goes crazy by performing analysis as well.

I tried - unsuccessfully - to disable it for that project by doing this in the csproj:

  <PropertyGroup>
    <EnforceCodeStyleInBuild>false</EnforceCodeStyleInBuild>
  </PropertyGroup>

How can I disable analysis for that specific project?

Upvotes: 2

Views: 1409

Answers (1)

Richard
Richard

Reputation: 108995

  1. You can disable code analysers in .editorconfig: see this question.

  2. An editorconfig in a child folder (setting root = false) will override/extend an .editorconfig in an ancestor folder.

So add a project specific editorconfig and use that to disable all the analysers you want to.

Upvotes: 3

Related Questions