Visual Studio 2012 Express代码分析 [英] Visual Studio 2012 Express Code Analysis

查看:176
本文介绍了Visual Studio 2012 Express代码分析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Microsoft文档讨论了可用于快速版的一组有限的代码分析工具(例如 Microsoft Visual Studio博客)。

The Microsoft documentation talks about a limited set of code analysis tools being available for the express edition (e.g. Microsoft Visual Studio Blog ).

我正在使用VS 2012 Update 3,并且在上下文菜单中看不到任何代码分析选项,也看不到任何按钮或菜单选项。我很确定我在某个时候进行了一些代码分析,但这可能是在安装更新2之前进行的。

I am using VS 2012 update 3, and can not see any code analysis options in context menus, or any buttons or menu options. I am pretty sure I ran some code analysis at some point, but that might have been before update 2 was installed.

有人知道此选项是否已从更多版本中删除吗?最近的速成版,如果没有,我可以找到合适的菜单项或设置来运行和查看代码分析结果。

Does anyone know if this option has been removed from more recent express editions, and if not where I can find the appropriate menu item or settings to be able to run and view the results of code analysis.

以下是Crippledsmurf给出的非常清晰的描述,显然可以从vs express访问代码分析。我必须以某种方式更改了某些选项,因为所描述的选项均不可访问:

there is a very clear description given below by Crippledsmurf, and it is obviously possible to access Code Analysis from vs express. I must have somehow changed some option, because none of the options described are accessible:

解决方案资源管理器-解决方案上下文菜单:

Solution explorer - solution context menu:

项目上下文菜单:

项目属性:

推荐答案

据我所知,代码分析仅在VS Express 2012 用于Windows桌面中可用-如果您有其他一些版本( Windows桌面版本除外),则可能不支持该版本。尝试谷歌搜索您的特定版本以确保。

As far as I know, code analysis is only available in VS Express 2012 For Windows Desktop - if you have some other version than the "for Windows Desktop" version, it may not be supported. Try Googling your specific version to make sure.

平台工具集可能不支持这些选项(项目属性->常规->平台工具集) 。

It may be that these options are not supported by your "platform toolset" (project properties -> general -> platform toolset).

例如,v110支持它,而v110_xp似乎不支持。

For example, v110 supports it, v110_xp does not seem to.

您仍然可以尝试构建菜单->在解决方案上运行代码分析(或按热键Alt-F11),但这会在您遇到问题时给您错误MSB8026:不支持静态分析当前平台工具集。

You can still try the "Build" menu -> "Run Code Analysis on Solution" (or hit the hotkey Alt-F11) but this will, if this is your problem, give you "error MSB8026: Static analysis is not supported with the current platform toolset."

如果这不起作用,请尝试项目属性-> C / C ++->常规-> SDL检查并将其设置为是( / sdl)。我隐约记得,直到我这样做时,它才对我显示,但是即使我再次删除该选项,代码分析选项也不会消失,因此可能不相关。

If that doesn't work, try project properties -> C/C++ -> General -> SDL checks and setting that to "Yes (/sdl)". I vaguely remember that it didn't show up for me until I did that, but even when I remove that option again, the code analysis option doesn't go away, so might not be related.

如果您需要(就像我一样)用于正常构建的其他平台工具集(不支持代码分析),则可能会导致您的Debug或Release配置无效,最好创建一个单独的分析配置:项目属性->配置管理器->活动解决方案配置->新建...->输入分析,从调试中复制设置。然后,您可以在其中设置平台工具集,并进行分析,而不必担心会破坏您的常规配置。

If you need (as I do) a different platform toolset for your normal builds, which does not support code analysis, then rather than beak your Debug or Release configurations, it may be better to create a separate "Analyze" configuration: project properties -> "Configuration Manager" -> Active solution configuration -> "New..." -> type "Analyze", copy across the settings from "Debug". Then you can set the platform toolset in there, and enable analysis, and not worry about it breaking your normal configurations.

尽管如此,我仍然无法理解它可以找到任何错误,即使我知道错误存在。因此,ymmv。

Even after all that though, I can't get it to find any errors, even though I know errors exist. So, ymmv.

这篇关于Visual Studio 2012 Express代码分析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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