Using SonarCloud through Azure Devops - Microsoft hosted agents - Building a C# project.
Over the last 48 hours our builds have started to fail their quality gates because SonarCloud is not picking up any code coverage. I can see the pipeline generates a .trx file successfully and the pipeline displays the correct number of results, but nothing is being picked up on the running code analysis step.
Looking back at our last successful build, the version of SonarScanning being used was for MSBuild 4.10 and that was working fine.
SonarScanner for MSBuild 4.10
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
14:14:39.581 Fetching code coverage report information from TFS...
14:14:39.583 Attempting to locate a test results (.trx) file...
14:14:39.646 Looking for TRX files in: D:\a\1\TestResults
14:14:39.646 The following test results files were found: D:\a\1\TestResults\VssAdministrator_WIN-G514LAIQLH3_2020-11-04_14_12_09.trx, D:\a\1\TestResults\VssAdministrator_WIN-G514LAIQLH3_2020-11-04_14_12_44.trx, D:\a\1\TestResults\VssAdministrator_WIN-G514LAIQLH3_2020-11-04_14_13_11.trx, D:\a\1\TestResults\VssAdministrator_WIN-G514LAIQLH3_2020-11-04_14_13_39.trx
14:14:39.736 The following code coverage attachments were found from the trx files: D:\a\1\TestResults\VssAdministrator_WIN-G514LAIQLH3_2020-11-04_14_12_09\In\WIN-G514LAIQLH3\VssAdministrator_WIN-G514LAIQLH3_2020-11-04.14_11_58.coverage, D:\a\1\TestResults\VssAdministrator_WIN-G514LAIQLH3_2020-11-04_14_12_44\In\WIN-G514LAIQLH3\VssAdministrator_WIN-G514LAIQLH3_2020-11-04.14_12_36.coverage, D:\a\1\TestResults\VssAdministrator_WIN-G514LAIQLH3_2020-11-04_14_13_11\In\WIN-G514LAIQLH3\VssAdministrator_WIN-G514LAIQLH3_2020-11-04.14_13_06.coverage, D:\a\1\TestResults\VssAdministrator_WIN-G514LAIQLH3_2020-11-04_14_13_39\In\WIN-G514LAIQLH3\VssAdministrator_WIN-G514LAIQLH3_2020-11-04.14_13_33.coverage
new build produces this at the start:
SonarScanner for MSBuild 5.0
Using the .NET Core version of the Scanner for MSBuild
Post-processing started.
09:11:57.965 09:11:57.965 WARNING: File 'C:\Users\VssAdministrator\.nuget\packages\microsoft.net.test.sdk\16.5.0\build\netcoreapp2.1\Microsoft.NET.Test.Sdk.Program.cs' is not located under the root directory 'D:\a\1\s' and will not be analyzed.
09:11:57.966 09:11:57.966 WARNING: File 'C:\Users\VssAdministrator\.nuget\packages\microsoft.testplatform.testhost\16.5.0\build\netcoreapp2.1\x64\testhost.exe' is not located under the root directory 'D:\a\1\s' and will not be analyzed.
09:11:57.966 09:11:57.966 WARNING: File 'C:\Users\VssAdministrator\.nuget\packages\microsoft.testplatform.testhost\16.5.0\build\netcoreapp2.1\x64\testhost.dll' is not located under the root directory 'D:\a\1\s' and will not be analyzed.
09:11:57.966 09:11:57.966 WARNING: File 'C:\Users\VssAdministrator\.nuget\packages\xunit.runner.visualstudio\2.4.0\build\netcoreapp1.0\xunit.runner.visualstudio.dotnetcore.testadapter.dll' is not located under the root directory 'D:\a\1\s' and will not be analyzed.
09:11:57.966 09:11:57.966 WARNING: File 'C:\Users\VssAdministrator\.nuget\packages\xunit.runner.visualstudio\2.4.0\build\netcoreapp1.0\xunit.runner.reporters.netcoreapp10.dll' is not located under the root directory 'D:\a\1\s' and will not be analyzed.
09:11:57.966 09:11:57.966 WARNING: File 'C:\Users\VssAdministrator\.nuget\packages\xunit.runner.visualstudio\2.4.0\build\netcoreapp1.0\xunit.runner.utility.netcoreapp10.dll' is not located under the root directory 'D:\a\1\s' and will not be analyzed.
09:11:57.968 09:11:57.968 WARNING: File 'C:\Users\VssAdministrator\AppData\Local\Temp\.NETFramework,Version=v4.5.SqlClrAttributes.cs' is not located under the root directory 'D:\a\1\s' and will not be analyzed.
Calling the SonarScanner CLI...
I can see the dotnet sonarscanner was released 3 days ago, so this must be the issue that has caused thie problem.
Thanks,
Pete