No ProjectInfo.xml files were found error from command prompt using MSBuild SonarQube Runner v1.0

给你一囗甜甜゛ 提交于 2019-12-14 02:38:39

问题


I'm trying out SonarQube using the new MSBuild SonarQube Runner v1.0.

The Pre-processing works fine

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.

Then MSBuild works

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

While end command following error gets generated

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

Required your assistance


回答1:


As pointed out by duncanpMS's comment, you need to run all the 3 commands from the folder of the project you want to analyze.

Here is how:

  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

You can add E:\sonarQube\MSBuild.SonarQube.Runner-1.0 to your %PATH% environment variable so that you can simply type MSBuild.SonarQube.Runner.exe instead of the full path from the command line when you analyze projects.




回答2:


You need msbuild version 12 or version 14. If you have VS2013 , Msbuild version 12 comes with it. If you have VS2015, Msbuild version 14 comes with it.

If you don't have , download Microsoft Build Tools 2013 or 2015.

Run Msbuild -version to verify the version before running the 3 commands sequentially in the solution folder.



来源:https://stackoverflow.com/questions/32505626/no-projectinfo-xml-files-were-found-error-from-command-prompt-using-msbuild-sona

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!