c++ - Fortify 在扫描 Visual Studio 项目时抛出错误

标签 c++ visual-studio-2008 fortify

我正在尝试在 Visual Studio 2008 项目上运行 Fortify。该项目自行成功构建。当我尝试使用 Visual Studio 集成控件通过 Fortify 分析项目时,项目构建成功但抛出错误消息。这是 Fortify 控制台的输出:

Fortify SCA...
Running: "-show-runtime-properties" 
Running: "-b" "ProjectName" "-clean" 
Error setting VCProject Path. Abort VC project related scan
Scan Failed Could not load file or assembly 'Microsoft.VisualStudio.VCProjectEngine, Version=8.0.0.0, Culture=neutral, PublicKeyToken=<string here>' or one of its dependencies. The system cannot find the file specified. 
   at FortifyBase.Scanner.CPPScanUtil.ResetVCProjectExecutableDirectories()
   at FortifyCommon.Scanner.BuildListeners.VSBuildDone(vsBuildScope scope, vsBuildAction action)
Scan Failed: 
Could not load file or assembly 'Microsoft.VisualStudio.VCProjectEngine, Version=8.0.0.0, Culture=neutral, PublicKeyToken=<string here>' or one of its dependencies. The system cannot find the file specified.

当我从独立的 Audit Workbench 运行 Fortify 时,我收到以下错误消息:

SCA Commandline invocation failed
[error]: Build ID "ProjectName" doesn't exist.

除了将“这是一个 J2EE Web 应用程序”更改为“否”之外,我保留了大部分默认扫描选项(我也尝试将其保留为"is",但这也没有用。

搜索有关错误消息的任何信息只会产生另一个 question在 Stack Overflow 上,但项目设置似乎与我的 Visual Studio 项目完全不同。无论如何,我也尝试使用 Visual Studio 提供的参数从命令行运行扫描,但我收到相同的错误消息。

Fortify 文档提到构建 ID 用于跟踪哪些文件作为构建的一部分被编译和链接,然后扫描这些文件,它通常是项目名称。我尝试了几个不同的字符串作为构建 ID,但似乎没有任何效果。

有人知道我哪里出错了吗?提前致谢。

更新:问题发生在分析的翻译阶段,因为根本没有创建构建 ID。这是来自 sourceanalyzer 日志的日志:

[2010-08-23 21:20:53 INFO]
Fortify Source Code Analyzer 5.1.0.0061
[2010-08-23 21:20:53 INFO]
Args:
["-b", "ProjectName", "-machine-output", "-vsversion", "8.0", "C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\Common7\\IDE\\devenv.exe", "ProjectName.sln", "/rebuild", "DEBUG"]
[2010-08-23 21:20:53 INFO]
VM Args:
"-XX:SoftRefLRUPolicyMSPerMB=100 -Xss1M -Xmx600M -Xms16M"
[2010-08-23 21:21:04 INFO 1102]
Compiler execution failed (exit code: 1).
[2010-08-23 21:21:04 WARNING]
exit(1)

最佳答案

好的,我认为这是 VS2010 上 C/C++ 翻译的一个已知问题。我找到的解决方法是:

  1. 打开 Visual Studio x86 命令提示符
  2. 切换到 KindleExport.sln 的目录
  3. 运行: sourceanalyzer -b kindleexport devenv KindleExport.sln/REBUILD
  4. 运行: sourceanalyzer -b kindleexport -scan -f KindleExport.fpr

关于c++ - Fortify 在扫描 Visual Studio 项目时抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3545887/

相关文章:

c++ - 无法安装 node-sass node.lib : fatal error LNK1107: invalid or corrupt file: cannot read at 0xB8790

c++ - 什么时候 abort() 优于 exit()?

asp.net - VS2008一起调试ASP和ASP.net

html - CSS图像间歇性加载

c++ - 如何将字符数组转换为字节数组?

c++ - 由于 32 位/64 位不匹配,无法解析外部符号 _glfwInit

c# - 打开不属于项目的 cs 文件时,有什么方法可以使 Intellisense 工作?

java - 强化错误: Unexpected Exception During Dataflow Analysis

security - 强化路径操作错误

JDBC、Fortify 和 Try-With-Resource