Is it possible to run the MSBUILD.SONARQUBE.RUNNER on a CSProj file as opposed to a solution?

梦想与她 提交于 2019-12-12 06:05:28

问题


I have a TFS xaml Build template that runs the msbuild.sonarqube.runner start (and end) before and (after the) msbuild task in the xaml.

It all works well enough with a .sln file. As the file under build.

However, when I attempt to use this on a build that runs msbuild on a .csproj file the end process reports that it cannot find the postprocess exe.

"Execution failed. The specified executable does not exist: .sonarqube\bin\MSBuild.SonarQube.Internal.PostProcess.exe"

there no error indication given by the Start command.

is there something special I need to do to get this to work, or is this a limitation of the MSBuild runner?

Please help. My whole team is keen to use the tool, but as it is only a fraction of the existing builds are being analyzed

thanks

Jeff Gedney


回答1:


The begin and end commands of the SonarQube Scanner for MSBuild, as well as all msbuild commands MUST be launched from the same current working directory. Indeed, they will all need access to the .sonarqube folder that is created by the begin command.

Other than that, you can launch MSBuild on a *.csproj file instead of a *.sln if you prefer - that is supported by the SonarQube Scanner for MSBuild.

I've created the following ticket to improve the error message in case end is launched from the wrong folder: https://jira.sonarsource.com/browse/SONARMSBRU-160




回答2:


Make sure you put yourself in the root folder of the project you want to analyze, then run the following commands:

a.MSBuild.SonarQube.Runner.exe begin /k:"sonarqube_project_key" /n:"sonarqube_project_name" /v:"sonarqube_project_version"

b.Build the project, for example: msbuild /t:Rebuild

c.MSBuild.SonarQube.Runner.exe end

Check:http://docs.sonarqube.org/display/PLUG/C%23+Plugin



来源:https://stackoverflow.com/questions/33555541/is-it-possible-to-run-the-msbuild-sonarqube-runner-on-a-csproj-file-as-opposed-t

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