比“构建解决方案”时更多的stylecop警告

时间:2021-10-11 16:55:33

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.

我正在使用VS 2017,.net Framework 7,stylecop 5.0。我在所有项目的'.csproj'文件中导入它,以便在构建解决方案时自动构建stylecop。当我构建解决方案时,它确实显示了stylecop警告。

When i right-click solution ->click "Run stylecop", I get more warnings than when I build normally.

当我右键单击解决方案 - >单击“运行stylecop”时,我收到的警告比正常构建时更多。

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')"

我用过这个:Import Project =“.. \ packages \ StyleCop.MSBuild.5.0.0 \ build \ StyleCop.MSBuild.targets”Condition =“Exists('.. \ packages \ StyleCop.MSBuild.5.0.0 \ build \ StyleCop.MSBuild.targets')”

1 个解决方案

#1


0  

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.

这通常是因为Visual Studio很体贴。它只会编译自上次构建以来已更改的源文件。因此,仅报告这些文件中的Stylecop问题。当您专门运行Stylecop时,它将评估所有c#源文件。

Try doing a rebuild rather than build and see if the numbers add up.

尝试进行重建而不是构建并查看数字是否相加。

#1


0  

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.

这通常是因为Visual Studio很体贴。它只会编译自上次构建以来已更改的源文件。因此,仅报告这些文件中的Stylecop问题。当您专门运行Stylecop时,它将评估所有c#源文件。

Try doing a rebuild rather than build and see if the numbers add up.

尝试进行重建而不是构建并查看数字是否相加。