尝试使用MSBuild.SonarQube.Runner.exe上的错误进行分析时出错

时间:2016-10-04 23:06:47

标签: jenkins msbuild sonarqube sonarqube-scan

我正在尝试在jenkins上运行C#代码分析,但总是会出现此错误

/var/jenkins_home/tools/hudson.plugins.sonar.MsBuildSQRunnerInstallation/SonarQube_Scanner_for_MSBuild_2.0/MSBuild.SonarQube.Runner.exe: 1:
 /var/jenkins_home/tools/hudson.plugins.sonar.MsBuildSQRunnerInstallation/SonarQube_Scanner_for_MSBuild_2.0/MSBuild.SonarQube.Runner.exe:
 MZ����@���: not found 
 /var/jenkins_home/tools/hudson.plugins.sonar.MsBuildSQRunnerInstallation/SonarQube_Scanner_for_MSBuild_2.0/MSBuild.SonarQube.Runner.exe: 1: 
 /var/jenkins_home/tools/hudson.plugins.sonar.MsBuildSQRunnerInstallation/SonarQube_Scanner_for_MSBuild_2.0/MSBuild.SonarQube.Runner.exe: ��kO����j: not found 
 /var/jenkins_home/tools/hudson.plugins.sonar.MsBuildSQRunnerInstallation/SonarQube_Scanner_for_MSBuild_2.0/MSBuild.SonarQube.Runner.exe: 22: 
 /var/jenkins_home/tools/hudson.plugins.sonar.MsBuildSQRunnerInstallation/SonarQube_Scanner_for_MSBuild_2.0/MSBuild.SonarQube.Runner.exe: ��V�0N Jl �@ ���.rsrc��P@@.reloc�X@B,lH,�2,�^�@j�0}s �~rp�)%rp�(7s o ~rp�)%r-p�(8s o ~~ o ~~ o *0�-r5ps z-rUps zQ~s o ( _�( o o (  (! _�i(_,=�%�%�s: File name too long 
 /var/jenkins_home/tools/hudson.plugins.sonar.MsBuildSQRunnerInstallation/SonarQube_Scanner_for_MSBuild_2.0/MSBuild.SonarQube.Runner.exe: 23: 
 /var/jenkins_home/tools/hudson.plugins.sonar.MsBuildSQRunnerInstallation/SonarQube_Scanner_for_MSBuild_2.0/MSBuild.SonarQube.Runner.exe: Syntax error: word unexpected (expecting ")") 
 ERROR: Execution of SonarQube Scanner for MSBuild failed (exit code 2) Finished: FAILURE

1 个答案:

答案 0 :(得分:4)

您正在尝试在类似Unix的操作系统上执行Windows二进制文件(“.exe”文件)。难怪为什么这不起作用。

如果要使用SonkinsQube Scanner for Jenkins和SonarQube Scanner for MSBuild构建.NET解决方案,则必须明确配置作业才能在Windows计算机上执行。