Can you disable styleCop in VS?
Scenario:
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.
For a way to do this through the VS2013 UI, in StyleCop 4.7.49 (I'm not sure what the minimum versions for this are), you can:
This requires you to edit the .sln file.
http://stylecop.codeplex.com/discussions/285902
The most effective way to achieve something like what you want would be to exclude all the files in your project from StyleCop analysis for one build configuration. If you add the following ItemGroup to your project file:
<ItemGroup>
<ExcludeFromStyleCop Include="**\*.cs" Condition=" '$(Configuration)' == 'DebugNoStyleCop' " />
<ItemGroup/>
...that will exclude all .cs files in your project from StyleCop analysis when the "DebugNoStyleCop" configuration is selected. Obviously you can choose some other configuration name that will suit you better by making the appropriate substitution. It's not quite the once-only "off" button that you'd like but it's fairly close.
I've setup a separate build configuration that doesn't run code analysis.
I now have the following configurations in VS:
You have to manually choose which configuration you want to build (i.e. step 3 in your list would be a manual step)
In the build targets file I've included code along these lines:
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug (No code analysis)' ">
<RunCodeAnalysis>false</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition="('$(RunCodeAnalysis)'=='true') and '$(Language)'=='C#' ">CODE_ANALYSIS;$(DefineConstants)</DefineConstants>
</PropertyGroup>