How do I disable all Roslyn Code Analyzers?
Disable below setting in Tools/Options/Text Editor/C#/Advanced and disable use 64-bit process for code analysis under analysis group. it was tested in vs2019.
Try a combo of the following in your csproj or Directory.Build.props files
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
<RunAnalyzersDuringLiveAnalysis>false</RunAnalyzersDuringLiveAnalysis>
<RunAnalyzers>false</RunAnalyzers>
https://docs.microsoft.com/en-us/visualstudio/code-quality/disable-code-analysis?view=vs-2019#net-framework-projects
You can disable analyzers on a per-project basis.
To do it, right click on Project>References>Analyzers in the Solution Explorer and hit Open Active Rule Set
You can disable individual analyzers or entire bundles of analyzers.
This creates a <ProjectName>.ruleset
file and modifies the <ProjectName>.csproj
, which means that you will share this configuration with your team unless you exclude these changes from source control.
Note: Changes are applied after you close and re-open the solution.
Changes to the .csproj
:
<Project ...>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<CodeAnalysisRuleSet>Example.ruleset</CodeAnalysisRuleSet>
Example.ruleset
file:
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Rules for WpfApplication1" Description="Code analysis rules for WpfApplication1.csproj." ToolsVersion="14.0">
<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp" RuleNamespace="Microsoft.CodeAnalysis.CSharp">
<Rule Id="AD0001" Action="None" />
<Rule Id="CS0028" Action="None" />
...