简体   繁体   English

Visual Studio 2013代码分析挂在本机代码上

[英]Visual Studio 2013 code analysis hangs on native code

I have a Visual Studio 2013 solution file containing three C++ projects - one is a library that gets linked in by the other two. 我有一个包含三个C ++项目的Visual Studio 2013解决方案文件-一个是由其他两个链接到的库。 All three use precompiled headers. 这三个都使用预编译头。

When I run Code Analysis (Build->Run Code Analysis on Solution, Analyze->Run Code Analysis on Solution, checking the 'run code analysis on build' option in project properties, etc.), the code analysis starts on the .cpp for the precompiled headers in the library project (stdafx.cpp), and then appears to hang, or otherwise go nowhere. 当我运行代码分析时(在解决方案上构建->运行代码分析,在解决方案上分析->运行代码分析,检查项目属性中的“在构建时运行代码分析”选项等),代码分析从.cpp开始库项目(stdafx.cpp)中预编译的头文件,然后似乎挂起,否则就无处可去。 The UI is still responsive, and I can cancel the build, but neither devenv.exe nor cl.exe are using anything like the CPU or RAM you'd expect, and code analysis doesn't appear to move on after leaving it for ~half an hour. UI仍然是响应式的,我可以取消构建,但是devenv.exe和cl.exe都没有使用您期望的CPU或RAM之类的东西,并且在将代码放置〜后,代码分析似乎没有继续进行半小时。

If I disable precompiled headers, the library project gets built, and then the same hang occurs during the "Running Code Analysis for C/C++..." step. 如果禁用预编译头,则会生成库项目,然后在“运行C / C ++代码分析...”步骤中发生相同的挂起。

I have previously run code analysis over the project before, although I can't remember how recently - possibly a week. 尽管我不记得最近(可能是一周),但之前我曾经对项目进行过代码分析。 The most significant change since then was refactoring a large number of functions into a template implementation. 此后最重大的变化是将大量功能重构为模板实现。 The project builds fine when not performing code analysis. 不执行代码分析时,项目构建良好。 No error windows appear, I can't find any error messages. 没有出现错误窗口,我找不到任何错误消息。 Visual Studio version is Professional 2013 Update 4, version number is 12.0.31101.00 Update 4. Visual Studio版本是Professional 2013 Update 4,版本号是12.0.31101.00 Update 4。

I've searched around on the internet but can't find any bug reports or the like from people experiencing similar problems. 我已经在互联网上四处搜寻,但找不到遇到类似问题的人的任何错误报告或类似内容。

Any thoughts on how I can fix this and get the code analysis tool running over the project again? 关于如何解决此问题并使代码分析工具再次在项目上运行的任何想法? Are there any logging mechanisms I might be missing that would help reveal what's going on? 我是否可能缺少任何日志记录机制来帮助揭示正在发生的事情?

I had also faced it quite a few times. 我也面对过很多次。 Hints: 提示:

  • Put it out of project setting, and then manually perform CA. 将其置于项目设置之外,然后手动执行CA。
  • Disable auto CA in project setting, build project. 在项目设置中禁用自动CA,构建项目。 Re-enable and build (not rebuild), and see if it works. 重新启用并进行构建(而不是重新构建),然后查看其是否有效。
  • Manually delete the output folder and normally build (with CA enable in project setting). 手动删除输出文件夹并正常构建(在项目设置中启用CA)。

For me, disabling it in project settings, followed by few changes in code, and then re-enabling CA with build - worked! 对我而言,在项目设置中将其禁用,然后在代码中进行少量更改,然后通过构建重新启用CA-奏效了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM