question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Coverlet collectors integration does not work on full framework projects

See original GitHub issue

In practice, it seems like coverlet is only compatible with analysing .net core projects? Could someone please confirm the current compatibility of Coverlet with respect to this bug https://github.com/microsoft/vstest/issues/2278

And update the project start page to reflect this would be great. I am trying to implement this on a .net full project, by calling vstest.console.exe directly with

$vstestconsolepath = “C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\Extensions\TestPlatform\vstest.console.exe”

$vsTestArguments = @( $testDlls #.net 4.6.2 “/logger:trx” “/InIsolation” “/collect:"XPlat Code Coverage”" “/TestCaseFilter:” + $testCaseFilters “/testadapterpath:” + (get-location).Path + "\packages\coverlet.collector.1.2.0\build\netstandard1.0" )

Microsoft (R) Test Execution Command Line Tool Version 16.4.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...

A total of 2 test files matched the specified pattern.
Data collection : Data collector 'XPlat Code Coverage' threw an exception during type loading, construction, or initialization: System.FormatException: Input string was not in a correct format.
   at System.Text.StringBuilder.FormatError()
   at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.Format(IFormatProvider provider, String format, Object[] args)
   at Microsoft.VisualStudio.TestPlatform.Common.DataCollector.DataCollectionManager.LoadAndInitialize(DataCollectorSettings dataCollectorSettings, String settingsXml).
Data collection : Data collector 'XPlat Code Coverage' threw an exception during type loading, construction, or initialization: System.FormatException: Input string was not in a correct format.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
NPadruttcommented, Mar 17, 2020

thanks @MarcoRossignoli. Your effort is greatly appreciated! 😃

1reaction
NPadruttcommented, Mar 17, 2020

@MarcoRossignoli Thank you! I found a blog post where he integrated it into teamcity via msbuild, so exactly what I was looking for and that worked. https://medium.com/@justingoldberg_2282/setting-up-code-coverage-with-net-xunit-and-teamcity-for-a-solution-with-multiple-test-projects-5d0986db788b

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can you use Coverlet to get code coverage data in a .NET ...
NET Framework solution and want to start collecting code coverage data as part of our build pipeline (as well as on our local...
Read more >
coverlet
Coverlet is a cross platform code coverage framework for .NET, with support for line, branch and method coverage. It works with .NET Framework...
Read more >
Use code coverage for unit testing - .NET
This article discusses the usage of code coverage for unit testing with Coverlet and report generation using ReportGenerator. While this article ...
Read more >
How to setup your dotnet project with test coverage reporting
Coverlet. Coverlet is a cross platform code coverage framework for .NET, with support for line, branch and method coverage. It works with ....
Read more >
Generate Code Coverage Report For .NET Core & .NET ...
collector or coverlet.msbuild to the codebase (test projects) => No source code modification is needed. Can support both .NET Framework and .NET Core...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found