问题
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:
cd E:\sonarQube\WebApplication2013
E:\sonarQube\MSBuild.SonarQube.Runner-1.0\MSBuild.SonarQube.Runner.exe begin /k:"MyKey" /n:"MyProject" /v:"1.0"
msbuild /t:rebuild
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