I am using VS 2017, .net Framework 7, stylecop 5.0. I imported it in '.csproj' file of all projects, so that stylecop builds automatically when the solution is built. It does show stylecop warnings when i built the solution.
When i right-click solution ->click "Run stylecop", I get more warnings than when I build normally.
Why doesn't it show when i build normally? Am I missing any commands?
I used this: Import Project="..\packages\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets" Condition="Exists('..\packages\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets')"
This is often due to Visual Studio being considerate. It will only compile source files that have changed since the last build. Therefore only the Stylecop issues in those files are reported. When you run Stylecop specifically it will assess all c# source files.
Try doing a rebuild rather than build and see if the numbers add up.