DotNet 4.6.2 with 1.0.0-preview2-1-003177

I have C# project build on Framework 462 with 1.0.0-preview2-1-003177 SDK. I am able from build from MSBuild but Sonar is unable to scan this. Please help me resolve this.

Step 1:
C:\sonar-scanner-msbuild-\SonarScanner.MSBuild.exe begin /k:“Project1”
Pre-processing succeeded.

Step 2:

C:\AdvancedMD\AdvancedMD.API.Clinical.Fields>dotnet build

Build completed.


C:\sonar-scanner-msbuild-\SonarScanner.MSBuild.exe end
SonarScanner for MSBuild 4.6.2
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
No analysable projects were found. SonarQube analysis will not be performed. Check the build summary report for details.
Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
14:10:55.775 Post-processing failed. Exit code: 1

Getting above error.

hi @aushmani

You should use SonarScanner.MSBuild.exe together with MSBuild.exe, and SonarScanner.MSBuild.dll together with dotnet.

In your case you are using the exe with dotnet. See Analyzing with SonarQube Scanner for MSBuild. Also, make sure you run all commands from the folder containing the solution (.sln file).

Thank you for your reply. I have .sln file with .xproj file as a project file… Does sonar has capability to compile the .xproj file. Kindly help me to fix this as I am unable to compile .xproj file from Sonar Build options.

@aushmani am I correct in thinking that an .xproj file is the legacy ASP.Net Core format that is no longer supported by Microsoft? If so, then the answer is no, analysing .xproj files is not supported by the Scanner for MSBuild.

The guidance from Microsoft is to migrate from the .xproj format to the supported .csproj format (which the Scanner for MSBuild will be able to analyze).

1 Like