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.

Upgrading coverlet.msbuild to 2.6.2 fails builds on travis that worked with earlier versions

See original GitHub issue

I was trying to upgrade the coverlet.msbuild on a few of my projects, only to find out that the new version fails with a type conversion exception.

The builds that fail when trying to generate the coverage report are all running on travis (both linux and osx, and both is failing) with .NET Core 2.1.603 installed.

Here is the exception/stack trace that gets outputted to the console

Exception/Stack trace
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error : Could not convert string '{"Line":19,"Ordinal":0}' to dictionary key type 'Coverlet.Core.Instrumentation.BranchKey'. Create a TypeConverter to convert from the string to the key type object. Path 'Results[0].Documents['/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov/CodecovRunner.cs'].Branches.{"Line":19,"Ordinal":0}', line 1, position 14191. [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, String id) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, String id) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader) [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Coverlet.Core.CoveragePrepareResult.Deserialize(Stream serializedInstrumentState) in C:\Users\toni\Workspace\coverlet\src\coverlet.core\CoveragePrepareResult.cs:line 21 [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]
/home/travis/.nuget/packages/coverlet.msbuild/2.6.2/build/coverlet.msbuild.targets(41,5): error :    at Coverlet.MSbuild.Tasks.CoverageResultTask.Execute() in C:\Users\toni\Workspace\coverlet\src\coverlet.msbuild.tasks\CoverageResultTask.cs:line 83 [/home/travis/build/cake-contrib/Cake.Codecov/Source/Cake.Codecov.Tests/Cake.Codecov.Tests.csproj]

And the links I can share to the failing builds: https://travis-ci.org/cake-contrib/Cake.Codecov/builds/542339897 https://travis-ci.org/cake-contrib/Cake.Transifex/builds/542340613 https://travis-ci.org/cake-contrib/Cake.Warp/builds/542341393

THe same projects are able to run coverlet.msbuild on appveyor, which leads me to believe there may have been a change in the latest version that would require to update the .NET Core SDK version (but I have not verified this yet).

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:29 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
MarcoRossignolicommented, Jun 10, 2019

@JSkimming as soon as @tonerdo do review/merge you’ll can test with nightly build, thank’s for help!

2reactions
AdmiringWormcommented, Jun 7, 2019

Fair, sorry for the inconvenience 😦 I’ll work on a fix asap.

No worries, I would probably never have noticed this if it weren’t for dependabot (I am lousy with updating dependencies manually, so it is good to rely on bots).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object Reference not set to an instance with Coverlet ...
My project is running .NET Core 2.2. EDIT [20/05/2019]. I managed to get this working by installing the references to Coverlet using Visual ......
Read more >
coverlet.msbuild 6.0.0
Coverlet is a cross platform code coverage library for .NET, with support for line, branch and method coverage.
Read more >
coverlet.msbuild 2.1.0
Threshold. Coverlet allows you to specify a coverage threshold below which it fails the build. This allows you to enforce a minimum coverage ......
Read more >
Error 'Unable to read beyond the end of the stream. ' in CL ...
Hello,. starting from yesterday we are encountering the following error during build test and collecting test results
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 >

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