Code Coverage–part 25

Install coverlet and report generator

dotnet tool install coverlet.console

dotnet tool install dotnet-reportgenerator-globaltool



dotnet coverlet Infovalutar.sln –target “dotnet” –targetargs “test InfovalutarTest\InfovalutarTest.csproj –configuration release –no-build” –format opencover –exclude “[xunit*]*”

dotnet reportgenerator “-reports:coverage.opencover.xml” “-targetdir:coveragereport” “-reporttypes:HTMLInline;HTMLSummary;Badges”


And the result ?No assemblies have been covered.

Updating all NuGet packages for the solution  – including a collector for coverlet.

Reading more, discover it works with

dotnet test –collect:”XPlat Code Coverage”  -r resultsFolder

The problem is that generates a GUID inside resultsFolder … and reportGenerator cannot be pointed to a random folder

Playing with different options, such as

dotnet test /p:CollectCoverage=true /p:CoverletOutput=’results’ /p:CoverletOutputFormat=json -v n

No results in the results directory…

Found obscure reference that I need to add package coverlet.msbuild


dotnet test –configuration release –no-build  /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura -v m /p:CoverletOutput=cob.xml

dotnet reportgenerator “-reports:InfovalutarTest/cob.xml” “-targetdir:coveragereport” “-reporttypes:HTMLInline;HTMLSummary;Badges”


And generates report.

And because I want those to be added in AzureDevOps at test I add –logger trx  and

– task: PublishTestResults@2
testRunner: VSTest
testResultsFiles: ‘**/*.trx’

– task: PublishCodeCoverageResults@1
codeCoverageTool: cobertura
summaryFileLocation: ‘**/cob.xml’

It works! Last: going to to have a display of the tests

![Azure DevOps tests (branch)](

![Azure DevOps cc](



And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at )
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe