The following article describes how to integrate StyleCop into the build, so that the tool will run automatically whenever a build is performed:

 http://blogs.msdn.com/sourceanalysis/pages/source-analysis-msbuild-integration.aspx