Visual Studio: temporarily disable StyleCop

Chris G. picture Chris G. · Jun 18, 2013 · Viewed 18.4k times · Source

Can you disable styleCop in VS?

Scenario:

  1. Press "Disable StyleCop" button
  2. Run/debug some test code
  3. The button automatically, enable StyleCop again. Therefore you have to actively disable it again it you want to run without StyleCop.

Answer

Dimitri Troncquo picture Dimitri Troncquo · Mar 23, 2018

You can disbale StyleCop for the entire solution by placing a Settings.StyleCop in the root of your solution folder, with the following contents:

<StyleCopSettings Version="105">
  <GlobalSettings>
    <BooleanProperty Name="RulesEnabledByDefault">False</BooleanProperty>
  </GlobalSettings>
</StyleCopSettings>

You'll need to restart Visual Studio after doing so.