-2

SonarQube Server runs fine,but when i use command line
"SonarQube.Scanner.MSBuild.exe begin /k:"org.sonarqube:sonarqube-scanner-msbuild" /n:"test" /v:"1.0" " I got this error, how to fix this? thanks
Using: Windows Server 2012 R2

Console output log from Jenkins: 建置中 工作區 C:\Program Files (x86)\Jenkins\workspace\CSS_SQ

C:\Program Files\Git\bin\git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
C:\Program Files\Git\bin\git.exe config remote.origin.url http://196.196.30.71:3000/megasilver/CSS.git # timeout=10 Fetching upstream changes from http://196.196.30.71:3000/megasilver/CSS.git
C:\Program Files\Git\bin\git.exe --version # timeout=10
C:\Program Files\Git\bin\git.exe fetch --tags --progress http://196.196.30.71:3000/megasilver/CSS.git +refs/heads/:refs/remotes/origin/
C:\Program Files\Git\bin\git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
C:\Program Files\Git\bin\git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10 Checking out Revision 7f08fd9d8f8d7f07ce0627fb98eb02f6f58a1256 (refs/remotes/origin/master) Commit message: "test"
C:\Program Files\Git\bin\git.exe config core.sparsecheckout # timeout=10
C:\Program Files\Git\bin\git.exe checkout -f
7f08fd9d8f8d7f07ce0627fb98eb02f6f58a1256 C:\Program Files\Git\bin\git.exe rev-list 7f08fd9d8f8d7f07ce0627fb98eb02f6f58a1256 # timeout=10 Injecting SonarQube environment variables using the configuration: SonarQube [CSS_SQ] $ "C:\Program Files (x86)\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SonarQube_Scanner_for_MSBuild\MSBuild.SonarQube.Runner.exe" begin /k:org.sonarqube:sonarqube-scanner-msbuild /n:test /v:1.0 /d:sonar.host.url=http://196.196.30.71:9000/ ********
未處理的例外狀況: System.MissingMethodException: 找不到方法: 'System.String System.String.Format(System.IFormatProvider, System.String, System.Object, System.Object)'。
於 SonarQube.Common.ConsoleLogger.GetFormattedMessage(String message, Object[] args)
於 SonarQube.Common.ConsoleLogger.LogInfo(String message, Object[] args)
於 SonarQube.Common.Utilities.LogAssemblyVersion(ILogger logger, Assembly assembly, String description)
於 SonarQube.Bootstrapper.Program.Main(String[] args)
於 SonarQube.Old.Bootstrapper.Program.Main(String[] args)
ERROR: Execution of SonarQube Scanner for MSBuild failed (exit code 255)
Finished: FAILURE

袁于婷
  • 43
  • 1
  • 7
  • No one is going to put effort in this, if your question doesn't have any either. Please edit your question and improve the format and explanation. – Granny Feb 01 '18 at 07:57
  • Sorry,thx for reminded me, it's my first time ask question, I have changed the format .Is it ok? – 袁于婷 Feb 01 '18 at 08:27
  • Better, but some more explanation about the problem would help. – Granny Feb 01 '18 at 08:42
  • What version of the .NET Framework is installed on your build slave? .NET 4.6 or later is required. – Val Feb 01 '18 at 09:05

1 Answers1

1

SonarQube Scanner for MSBuild requires .NET 4.6 or later. Please, ensure it is installed on all your build machines.

Val
  • 1,920
  • 1
  • 11
  • 14
  • Thanks a lot, I found that .NET 4.5 version, and it solved this error. – 袁于婷 Feb 02 '18 at 04:03
  • I got the other error now.The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects. Possible causes: 1. The project has not been built - the project must be built in between the begin and end steps 2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0 upwards are supported 3. The begin, build or end steps have not all been launched from the same folder, I have already checked 1 and 2. – 袁于婷 Feb 02 '18 at 06:16
  • @袁于婷 please, open a new question about that. To save time you could run the begin step of the analysis with `/d:sonar.verbose=true` command line argument and then add to the question the full logs of the SonarQube.Scanner.MSBuild.exe begin and end steps, as well as MSBuild.exe. Thanks! – Val Feb 02 '18 at 09:18