Hi,
I’m struggling with a project of mine that, when analyzed, returns no source code at all (and hence analyzes naught).
I’m using MSBuild-integrated analyzer in a yaml-based build in Azure DevOps.
I suspected the issue was due to my project being named AddUp.RabbitMQ.Fakes (the fakes part may collide with the test project detection logic somehow). So I tried to force this project to be considered worth analyzing by adding this to AddUp.RabbitMQ.Fakes.csproj
:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
...
<SonarQubeTestProject>false</SonarQubeTestProject>
<SonarQubeExclude>false</SonarQubeExclude>
</PropertyGroup>
Alas, all my attemps failed: Azure DevOps log keeps telling me this for the analysis step:
The exclude flag has been set so the project will not be analyzed by SonarQube. Project file: D:\a\1\s\src\AddUp.RabbitMQ.Fakes\AddUp.RabbitMQ.Fakes.csproj
The exclude flag has been set so the project will not be analyzed by SonarQube. Project file: D:\a\1\s\src\AddUp.RabbitMQ.Fakes.Tests\AddUp.RabbitMQ.Fakes.Tests.csproj
##[error]No analysable projects were found. SonarQube analysis will not be performed. Check the build summary report for details.
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.
##[error]10:43:53.561 Post-processing failed. Exit code: 1
10:43:53.561 Post-processing failed. Exit code: 1
##[error]The process 'D:\a\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.10.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe' failed with exit code 1
Finishing: Sonarcloud - Analyze
For reference,
- I’m building the project using
dotnet build
rather thanMSBuild.exe
and .NET Core SDK is 3.0.100 - I’m targeting Windows
- Using SonarCloudPrepare and SonarCloudAnalyze v1.10.0
- here is the code (with
azure-pipelines.yml
): https://github.com/addupsolutions/AddUp.RabbitMQ.Fakes - here is the sonarcloud dashboard: https://sonarcloud.io/dashboard?id=addup-rabbitmq-fakes (NB: the dashboard shows some code, but that’s due to previous analyses when I hadn’t yet tagged the test project as such)…
Hope someone can help.
Thanks!