I will preface this that my current solution to this is very easy but one I do not want to keep implementing.
The Problem
Below you will see an image outlining my current build steps. Each of these contain the default settings, with the Prepare analysis on SonarQube
setup to point to my endpoint.
When I run this, again just default settings, I am presented with the following errors
WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed by SonarQube. Project file: "D:\a\1\s\API.Tests.csproj"
WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed by SonarQube. Project file: "D:\a\1\s\API.csproj"
This is because the build step for dotnet core, by default, looks for **/*.csproj
using the linked setting (Parameters.RestoreBuildProjects)
- with the update to the csproj format the project guid is no longer stored in the csproj files. What I suspect is happening is that SonarQube just defaults the guids when it finds nothing defaults to 000...
and then throws this error.
The Fix
Unlinking the Path to project(s)
parameter and pointing to **/.*.sln
fixed the issue, because now SonarQube can see the project guids (defined the .sln
)
The Question, finally
After that long winded explanation I am lead to ask if there is a better way to get SonarQube to recognise dotnet core projects.
I do not want to change the default build task every time I create a project to satisfy SonarQube's requirements.