- Community Edition
- Version 7.9.3 (build 33349)
- vscoveragexml format
- Analyze coverage for a .net Core Solution with multiple projects
Hi all,
I apologize if this question is answered or documented elsewhere but I have not been able to find it here or on StackOverflow. Similar, but not the same.
I have a fairly simple .net Core solution containing the following:
*App.Web.csproj (aspnetcore web project)
*App.Data.csproj (class library project)
*App.Test.csproj
I am using Visual Studio 2019 Enterprise and the VSTest Console results in the IDE show coverage for all three (including the test project.)
My basic steps (in Jenkins) are as follows (edited for brevity):
dotnet sonarscanner begin <with switches, params etc>
dotnet test --collect “Code Coverage” --results-directory :
CodeCoverage.exe analyze /output:App.coveragexml App.coverage
dotnet sonarscanner end
I am happy to share more detail if necessary.
This is the same setup that we have for another project which is in production and functioning perfectly except that it only has one project plus the test project.
The issue is that the Web project calls the classes in the Data project and the Web project shows coverage but the Data project does not.
Please advise as to what additional information I can provide. I have tried changing formats to opencover but have not been successful thus far. Opencover also presents a different(even less accurate) level of coverage. I have also attempted to implement a runsettings file in the solution to attempt to force the coverage collection but this was also unsuccessful.
I am just trying to confirm that what I am attempting is in fact possible and if so, what am I doing wrong?
Thank you!