简体   繁体   中英

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. 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. 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.

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.

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.

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.
  • Disable auto CA in project setting, build project. 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).

For me, disabling it in project settings, followed by few changes in code, and then re-enabling CA with build - worked!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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