0

I am trying to configure SonarQube to build .net core projects, the build itself succeed but is getting the following error in the Complete SonarQube Analysis build step:

2017-07-27T08:25:21.5598883Z ##[error]No analysable projects were found. SonarQube analysis will not be performed. Check the build summary report for details.

We are using:

  • Java 8 on both SonarQube server and scanner
  • SonarQube Version 6.2
  • SonarQube Scanner for MSBuild 3.0
  • Sonar C# 6.1.0.2359
  • MSBuild 14.0

but according to https://jira.sonarsource.com/browse/SONARMSBRU-167 ,

it is already resolved in v2.3 , where as we are using v3.0.

The xproj looks like this:

..
  <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
  </PropertyGroup>
  <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
  <PropertyGroup Label="Globals">
    <ProjectGuid>b43fc99f-b98f-4300-9a71-5252e01a602e</ProjectGuid>
    ...
    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
..

it has a project guid which according to https://jira.sonarsource.com/browse/SONARMSBRU-167 is the main reason of why the scanner exclude them from the analysis. Target framework is installed in the build server and we are using the correct msbuild version to build it.

Are there any ways to make SonarQube work with xproj files?

Mc Kevin
  • 962
  • 10
  • 31

1 Answers1

1

xproj format is deprecated by Microsoft itself. Per Microsoft own recommendations, you should migrate to the standard csproj format (using tools mentioned on that Microsoft migration page).

Per your observations, SonarQube .Net ecosystem (SonarC#, Scanner for MSBuild) will then support analysis of your .Net Core projects in csproj format.

Nicolas B.
  • 7,245
  • 17
  • 29
  • Thanks Nicolas, the last time someone raised this issue got fixed in 2.3 and I don't see any issue raised since then, I thought it has to do with my configuration. – Mc Kevin Jul 27 '17 at 09:12