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.

` Failed to resolve assembly` when running dotnet test with coverage

See original GitHub issue

When I run command dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover all test are passing and code coverage is correctly generated which is good. However returned exit code from command is 1 due to this error:

coverlet.msbuild\1.0.2\build\netstandard2.0\coverlet.msbuild.targets(13,5): error : Failed to resolve assembly: 'Common, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null' [C:\Source\Repos\MyApp\src\Test\Test.csproj]

Where Common is one of the referenced projects. When I just run dotnet test everything is working and exit code is 0.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11

github_iconTop GitHub Comments

9reactions
jp7677commented, Apr 19, 2018

Just for reference, I had the same issue with some 3rd party packages, even with version 1.1.1. Including <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> in the project file of my test project fixed it for me.

7reactions
jp7677commented, Aug 13, 2018

PS: An even better way than modifying your *.csprof file is to run dotnet test like dotnet test /p:CollectCoverage=true /p:CopyLocalLockFileAssemblies=true

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why dotnet test tool is not creating code coverage report?
Basically I forgot to add the coverlet msbuild NuGet package into my test project. After that, all worked fine with the following command:...
Read more >
Troubleshoot code coverage - Visual Studio
In Test Explorer, select Run All to verify that the tests run successfully. Fix any failures before using Analyze Code Coverage.
Read more >
Azure Piplines throw error when running tests in .net core ...
Data collector 'Code Coverage' message: Failed to initialize code coverage datacollector with error: System.TypeLoadException: Could not load ...
Read more >
Azure DevOps: tests failing when addressing multiple .Net ...
Data collector 'Code Coverage' message: Failed to initialize code coverage datacollector with error: System.TypeLoadException: Could not load ...
Read more >
Customizing Code Coverage Analysis - Visual Studio
Learn how to install and use the dotnet-coverage CLI tool to collect code coverage data of a running process.
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