SonarQube is not able to correctly handle the "new" csproj format. It always requires the otherwise useless <ProjectGuid> entry in the csproj.
The "new" csproj format is all about conciseness and minimalism adding back all those useless XML elements defeats its whole purpose.
Create a new .NET Core project using dotnet new or Visual Studio including a Solution file.
Run it through SonarQube Analysis
SonarQube correctly analyzes and reports the analysis about my solution. Without having to add a <ProjectGuid> to the csproj.
The projects are not analysed and the following error occurs:
WARNING: The following projects do not have a valid ProjectGuid and were not built using a valid solution (.sln) thus will be skipped from analysis...
Add a <ProjectGuid> to the csproj with an arbitrary unique guid value as described here and here.
Hi @bitbonk,
I am closing this issue as duplicates of this issue https://github.com/SonarSource/sonar-scanner-msbuild/issues/659
Feel free to subscribe to the other issue to get notified about the fix!
Cheers,
Amaury
If it helps anyone, this PowerShell script will find all of your .csproj files and add a ProjectGuid if it's missing.
https://github.com/ikemtz/NRSRx/blob/master/sonarqube-create-project-guids.ps1
If it helps anyone, this PowerShell script will find all of your .csproj files and add a ProjectGuid if it's missing.
https://github.com/ikemtz/NRSRx/blob/master/sonarqube-create-project-guids.ps1
The updated link is https://github.com/ikemtz/NRSRx/blob/master/tools/sonarqube-create-project-guids.ps1
Most helpful comment
If it helps anyone, this PowerShell script will find all of your .csproj files and add a ProjectGuid if it's missing.
https://github.com/ikemtz/NRSRx/blob/master/sonarqube-create-project-guids.ps1