Iv’e tried other project and now the build is successed but the scanner end step failed with this errors:
SonarScanner for MSBuild 4.6.2
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
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 and 15.0 are supported
3. The begin, build and end steps have not all been launched from the same folder
4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)
Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
11:27:03.368 Post-processing failed. Exit code: 1
Are there any messages in the MSBuild console output that start with Sonar: ?
what do you mean in " MSbuild Console" I’ve ran the commands from “cmd” and the output of the “Rebuild” is all in the cmd console.
I’ve got “0” errors there:
47 Warning(s)
0 Error(s)
Please share the commands you are running.
I copy the commands from the Sonarqube console (localhost:9000).
1. SonarScanner.MSBuild.exe begin /k:"csharp2" /d:sonar.host.url="http://localhost:9000" /d:sonar.login="91724855f2aa513413c7fa18a4fa0f6130445e02"
2. MsBuild.exe /t:Rebuild
3. SonarScanner.MSBuild.exe end /d:sonar.login="91724855f2aa513413c7fa18a4fa0f6130445e02"
I’d expect to see more console output from MSBuild. When running the msbuild step, trying specifying the logging level explicitly:
msbuild /t:rebuild /v:normal
There should be messages starting "Sonar: " .e.g.
...
WriteSonarQubeProjectData:
Sonar: (NetFx35_WindowsFormsApplication1.csproj) Number of files to analyse: 6. The list of files to be analyzed is i
n d:\code\VS2015\NetFx35_WindowsFormsApplication1\.sonarqube\out\0\FilesToAnalyze.txt.
...
@Erez_Dasa your build log is full of messages like the following:
C:\temp\csahrp\gitextensions-master\gitextensions\GitExtensions\GitExtensions.csproj.metaproj : warning MSB4078: The pr
oject file “GitExtensions\GitExtensions.csproj” is not supported by MSBuild and cannot be built.
It doesn’t look like any of the projects are being built, so none of them will be analysed either.
A quick look at the MSBuild projects in the repo shows they are in the new MSBuild “SDK” format that isn’t understood by the older v14.0.25420.1 that you are using.
You will need to upgrade to a newer version of MSBuild to build the gitextension solution (e.g. the “Build Tools for Visual Studio 2019” under the “Tools for Visual Studio 2019” on this page).
Thank you @duncanp and sorry for the delay in my answer.
I’ve downloaded the new “build tools” but it’s seems like the same error is displaying again:
The project file "*****\*****\******.csproj" is not supported by MSBuild and cannot be built.
I don’t think the problem is in sonarqube, seems like the problem is in my build process, i’ll try to figure it out and understand what cause the problem. Any help by you and the community here will be appreciated.
@Erez_Dasa FYI the latest MSBuild tools can handle the older project file formats, which suggests that the build isn’t using the version of MSBuild you have just installed. Have a look a the first line of the MSBuild log output to check the expected version of the MSBuild exe is being called:
d:\repos\sq\slvs>msbuild
Microsoft (R) Build Engine version 16.5.0+d4cbfca49 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
Build started 20/04/2020 11:19:02.
...