Closed peibol71 closed 1 month ago
Please check whether PDB files are available in the output folder.
Locates the unit test assembly and selects all the referenced assemblies that have PDBs.
https://github.com/coverlet-coverage/coverlet?tab=readme-ov-file#how-it-works
There is one PDB file (projectname.pdb) in projectfolder\obj\Release\net6.0 and the same and 4 others in projectfolder\bin\Release\net6.0
Maybe diagnostic logs will provide more information.
dotnet test --collect:"XPlat Code Coverage" --settings runsettings --diag:log.txt
Sorry, that's not a bug. There was a misconfigured Directory.Build.props file and the project was using coverlet.collector v1.0 instead of v6.0.2
No problem. Please close the issue.
I can't get the coverage.coverture.xml file because of this exception error
I'm using this command: dotnet test -c Release --collect:"XPlat Code Coverage"
And get this error message: Data collector 'XPlat code coverage' message: Coverlet.Collector.Utilities.CoverletDataCollectorException: CoverletCoverageDataCollector: Failed to get coverage report ---> System.IndexOutOfRangeException: Index was outside the bounds of the array. at Coverlet.Core.Reporters.CoberturaReporter.Report(CoverageResult result) at Coverlet.Collector.DataCollection.CoverageManager.GetCoverageReport(CoverageResult coverageResult) --- End of inner exception stack trace --- at Coverlet.Collector.DataCollection.CoverageManager.GetCoverageReport(CoverageResult coverageResult) at Coverlet.Collector.DataCollection.CoverageManager.GetCoverageReport() at Coverlet.Collector.DataCollection.CoverletCoverageCollector.OnSessionEnd(Object sender, SessionEndEventArgs e).
.NET configuration:
Any idea?
Thanks.