Posts

Showing posts from June, 2020

SonarQube Code Coverage, Azure DevOps and .NET Core

Image
How do you get SonarQube/SonarCloud code coverage to work with .NET Core and Azure DevOps? These steps assume that you are using .NET Core 3.x and that you have already have a Azure DevOps Build Pipeline integrated with SonarQube/SonarCloud. However, you are unable to get the code coverage statistic to work. Step One: Make it work in the IDE I'm using Xunit to run my unit tests, so I've added the following Nuget packages to my test project. Make sure your tests run successfully in your IDE. Microsoft.NET.Test.Sdk Xunit Xunit.runner.visualStudio Step Two: Add the SonarQube Properties Add the following two extra properties to your SonarQubePrepare task in your Azure DevOps build pipeline. sonar.cs.vstest.reportsPaths=$(Agent.TempDire