Visual Studio 2010的code分析 - 解决方案上运行 [英] Visual Studio 2010 Code Analysis - Run on Solution

查看:361
本文介绍了Visual Studio 2010的code分析 - 解决方案上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想手动运行code分析为整个解决方案,而不是建设项目,未使用的FxCop,如果可能的话。我没有使CA的版本,但它真的,真的放慢了构建过程,我们不能有。但似乎不可思议,我认为code分析只能每个项目通过菜单手动运行,而不是整个项目。

I would like to manually run code analysis for an entire solution, not on building the project, and not using FXCop, if possible. I did enable CA on build but it really, really slowed down the build process, and we can't have that. But it seems weird to me that code analysis can only be run per project manually through the menus, but not for an entire project.

我缺少的东西?

感谢。

推荐答案

我也不知道菜单/命令可用于所有项目运行的CA,但您可以创建一个新的解决方案的配置(如$根据调试C $ cAnalysis),并成立了CA对每一个项目运行该配置,让您运行CA的所有项目,而不会减慢您的常规调试版本。

I also don't know of a menu/command that can be used to run CA for all projects, but you can create a new solution configuration (e.g. CodeAnalysis based on Debug) and set up CA for each project to run for that Configuration, letting you run CA for all projects without slowing down your regular Debug build.

  1. 创建一个名为code解析新配置(建设 - >配置管理器,然后<新建...>在活动解决方案配置)。

  1. Create the new configuration called "Code Analysis" (Build -> Configuration Manager, then <New...> under Active solution configuration).

在CA的属性选项卡中的每一个项目,将CA运行,为code分析的配置,和的不是的竞选调试配置(以及任何其他配置你不想CA来运行)。

In the CA properties tab for each project, set CA to run for the "Code Analysis" configuration, and not to run for the Debug configuration (and any other Configurations you don't want CA to run on).

您可以做code合同选项卡上的相同的,如果你通常不希望合同检查你的常规构建配置。

You can do the same on the Code Contracts tab if you normally don't want contract checking on your regular build configurations.

现在,当您设置您的解决方案配置,调试和构建,你不应该被执行CA和CC。当你想要做的CA和CC检查,配置更改为code分析和建设。

Now when you set your solution configuration to Debug and build, you should not have CA and CC being performed. When you do want the CA and CC checks done, change the configuration to 'Code Analysis' and build.

这是不是很方便的菜单或工具栏选项,但它可能是,你的作品替代。

It's not as convenient as a menu or toolbar option, but it might be an alternative that works for you.

希望这有助于。

这篇关于Visual Studio 2010的code分析 - 解决方案上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆