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.

Tests fail if assembly is strong named

See original GitHub issue

I’m trying to use Coverlet against an assembly that is strong named. When running those tests on the .NET 4.6.1 target, I get many errors similar to this:

Failed   Tests.MinMax.Min_AsyncSelector_Int32_4
Error Message:
 System.TypeInitializationException : The type initializer for 'Tests.AsyncEnumerableTests' threw an exception.
---- System.IO.FileLoadException : Could not load file or assembly 'System.Linq.Async, Version=4.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263' or one of its dependencies. Strong name signature could not be verified.  The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
Stack Trace:
   at Tests.AsyncEnumerableTests..ctor()
   at Tests.MinMax..ctor()
----- Inner Stack Trace -----
   at Tests.AsyncEnumerableTests..cctor()

Is there a way to make this work?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
MarcoRossignolicommented, Jan 31, 2020

Thank’s for your opinion, it’s very appreciated really. I’m reading/listening on media the trends rumors and I don’t have a strong opinion today. We have a pair of issue on netfx and I’m a “bit” alone at the moment, so my idea is to work more on “default/expected coverlet enviroment”, it’s the default .net core cross code coverage tool AFAIK and it’s the build-in choice for dotnet test so I’m putting more effort on better vstest integration and support better msbuild features(msbuild suffer of very time spending investigation issue https://github.com/tonerdo/coverlet/blob/master/Documentation/KnowIssues.md#1-vstest-stops-process-execution-earlydotnet-test). But as maintainer I don’t forget anybody and I try to track and spend my time to improve this tool on every aspect and better I can, so sorry for these defects 😞 You can read discussion here and add your opinion https://github.com/tonerdo/coverlet/issues/683 https://github.com/tonerdo/coverlet/pull/704

1reaction
MarcoRossignolicommented, Feb 19, 2019

@tonerdo maybe we should document?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Assembly.Load fails within a test case (strong naming ...
I'm presuming that the failure to verify the strong name of the 'tests' version of the Npgsql driver is the root cause of...
Read more >
Three ways to tell if a .NET Assembly (DLL) has Strong Name
Approach #1: Testing for Strong Name on Command Line or in a Script ... If an assembly is not strongly named, the Public...
Read more >
CA2210: Assemblies should have valid strong names
This rule retrieves and verifies the strong name of an assembly. A violation occurs if any of the following are true:.
Read more >
Trying to profile a unit test fails with FileLoadException ...
A few things here to note. 1) After the profile session failed, the results panel at the bottom of test explorer shows my...
Read more >
Strong name validation failed - Build/Test Issues
Tests' is invalid. Strong-name signed assemblies must specify a public key in their InternalsVisibleTo declarations. Your preprocessor directive ...
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