首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用MSBuild SonarQube Runner v1.0从命令提示符找不到ProjectInfo.xml文件时出错

使用MSBuild SonarQube Runner v1.0从命令提示符找不到ProjectInfo.xml文件时出错
EN

Stack Overflow用户
提问于 2015-09-10 23:11:07
回答 2查看 2.5K关注 0票数 1

我正在使用新的MSBuild SonarQube Runner v1.0试用SonarQube。

预处理工作正常

代码语言:javascript
复制
E:\sonarQube\MSBuild.SonarQube.Runner-1.0>MSBuild.SonarQube.Runner.exe begin /k:"MyKey" /n:"MyProject" /v:"1.0"
.......
Process returned exit code 0
Pre-processing succeeded.

然后MSBuild就可以工作了

代码语言:javascript
复制
E:\sonarQube\WebApplication2013>msbuild
Microsoft (R) Build Engine version 4.0.30319.34209
[Microsoft .NET Framework, version 4.0.30319.34209]
Copyright (C) Microsoft Corporation. All rights reserved.
........

Done Building Project "E:\sonarQube\WebApplication2013\WebApplication2013.sln" (default targets).


Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.51

生成错误后的结束命令

代码语言:javascript
复制
E:\sonarQube\MSBuild.SonarQube.Runner-1.0>MSBuild.SonarQube.Runner.exe end
.......
6:35:10 PM  Generating SonarQube project properties file to E:\sonarQube\MSBuild.SonarQube.Runner-1.0\.sonarqube\out\sonar-project.properties
6:35:10 PM  No ProjectInfo.xml files were found. Check that the analysis targets are referenced by the MSBuild projects being built.
6:35:10 PM  Writing processing summary to E:\sonarQube\MSBuild.SonarQube.Runner-1.0\.sonarqube\out\ProjectInfo.log
6:35:10 PM  Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
6:35:10 PM  Creating a summary markdown file...
Process returned exit code 1
Post-processing failed. Exit code: 1

需要你的帮助

EN

回答 2

Stack Overflow用户

发布于 2015-09-11 17:54:31

正如duncanpMS的评论所指出的,您需要运行您想要分析的项目文件夹中的所有3个命令。

下面是如何实现的:

  1. cd E:\sonarQube\WebApplication2013
  2. E:\sonarQube\MSBuild.SonarQube.Runner-1.0\MSBuild.SonarQube.Runner.exe begin /k:"MyKey" /n:"MyProject" /v:"1.0"
  3. msbuild /t:rebuild
  4. E:\sonarQube\MSBuild.SonarQube.Runner-1.0\MSBuild.SonarQube.Runner.exe end

您可以将E:\sonarQube\MSBuild.SonarQube.Runner-1.0添加到%PATH%环境变量中,以便在分析项目时只需从命令行输入MSBuild.SonarQube.Runner.exe,而不是完整路径。

票数 2
EN

Stack Overflow用户

发布于 2016-04-07 05:13:11

您需要msbuild版本12或版本14。如果您有VS2013,则Msbuild版本12随附。如果您有VS2015,Msbuild版本14会附带它。

如果还没有,请下载Microsoft Build Tools 2013或2015。

在解决方案文件夹中按顺序运行这3个命令之前,请先运行Msbuild -version以验证版本。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32505626

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档