今天在使用 Azure DevOps 搭配 SonarQube 做程式碼分析的時候,遇到執行分析時找不到 .NET Core 專案的錯誤,但是過去明明就可以對 .NET Core 專案程式碼作分析,怎麼會報出 No analysable projects were found 的錯誤訊息呢?
錯誤訊息
遇到的錯誤訊息畫面如下:
1 2 3 4 5 6
##[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]01:26:51.663 Post-processing failed. Exit code: 1 01:26:51.663 Post-processing failed. Exit code: 1 ##[error]D:\a\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\4.6.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe failed with return code: 1
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... D:\a\1\s\XXXXXXXX.MessageCardModel.csproj, D:\a\1\s\XXXXXXXX.HttpClientLibrary.csproj, D:\a\1\s\XXXXXXXX.MessageCardModel.csproj, D:\a\1\s\XXXXXXXX.MessageCardModel.csproj, D:\a\1\s\XXXXXXXX.HttpClientLibrary.csproj, D:\a\1\s\UdspHub\UdspHub.csproj WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed by SonarQube. Project file: "D:\a\1\s\XXXXXXXX.MessageCardModel.csproj" WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed by SonarQube. Project file: "D:\a\1\s\XXXXXXXX.HttpClientLibrary.csproj" WARNING: Duplicate ProjectGuid: "00000000-0000-0000-0000-000000000000". The project will not be analyzed by SonarQube. Project file: "D:\a\1\s\UdspHub\UdspHub.csproj"
原來 WARNING 的這一句 The following projects do not have a valid ProjectGuid 才是關鍵所在。