Prakash Kumar
Prakash Kumar

Reputation: 31

Disable Roslyn Analyzer in debug mode

I wanted to know how do I disable all roslyn analyzers in entire solution during debug mode but keep them enable in release mode? I can find references to disable them permanently or individually.

Upvotes: 1

Views: 395

Answers (1)

JosephDaSilva
JosephDaSilva

Reputation: 1187

Add the following to the .csproj file of your project:

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
    <RunAnalyzers>false</RunAnalyzers>
</PropertyGroup>

This will disable all analyzers for debug builds, but not for release builds.

Upvotes: 4

Related Questions