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
The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
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
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.
Sonar: (NetFx35_WindowsFormsApplication1.csproj) Number of files to analyse: 6. The list of files to be analyzed is i
@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:
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.