This project is read-only.

Migrated to GitHub!

Project Description
StyleCop Checkin Policy for Visual Studio.
Check your code for StyleCop errors/warnings before you can check-in your code into Team Foundation Server.

This CodePlex site is the sourcecode for the Visual Studio check-in policy for checking your code with StyleCop. This check-in policy could be installed by the Visual Studio gallery for Visual Studio 2013, Visual Studio 2015 or you can download it from the download page.


  • Global StyleCop settings for whole Team Project
  • Import your current StyleCop settings (if you already use StyleCop) into the check-in policy
  • Export the StyleCop settings of the check-in policy
  • Override the settings for specific projects with the power of merged StyleCop settings files
  • Thread the Check-in violations as errors, warnings or information messages in Visual Studio
  • Exclude folders to be checked


  • Visual Studio 2013
  • Visual Studio 2015

Optional note
Set the "/p:StyleCopTreatErrorsAsWarnings=false" (without quotes) parameter in your build definition to throw an error when there is a StyleCop warning. This works if you have the NuGet StyleCop.MSBuild package installed. This way your build will fail so no corrupt code is checked-in. This check-in policy prevents users from checking-in bad code but it is a check-in policy so it could be overridden. You can set this parameter in your build definition on the "Process" tab, under the "Advanced" category and then the "MSBuild Arguments" property.

Disclaimer note
The original code is from another CodePlex project called Source Analysis Policy. This code is altered because the original project stopped supporting new versions of Visual Studio and StyleCop. The functionality is for some parts the same but a lot is altered like support for the latest StyleCop version and the new extension methods of Visual Studio with vsix files.

Last edited Aug 15, 2017 at 7:58 AM by LockTar, version 14