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.

Missing strong name when using nunit3testexecutor

See original GitHub issue

I’m trying to use coverlet with the NUnit3TestAdapter package. However, I get an error message telling me that coverlet.core does not have a strong name. Is it possible to sign the package?

I created the following test project:

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
  <TargetFramework>net461</TargetFramework>
</PropertyGroup>

<ItemGroup>
  <PackageReference Include="coverlet.msbuild" Version="1.0.2" />
  <PackageReference Include="NUnit" Version="3.10.1" />
  <PackageReference Include="NUnit3TestAdapter" Version="3.10.0" />
</ItemGroup>

</Project>

The project contains one file, Tests.cs:

using NUnit.Framework;

namespace SimpleTestProject
{
    
    public class Tests
    {
        [Test]
        public void FailingTest()
        {
            Assert.That(false);
        }

        [Test]
        public void SucceedingTest()
        {
            Assert.That(true);
        }
    }
}

If I run the tests using dotnet test I get the following result:

Build started, please wait...
Build completed.

Test run for C:\Users\Maarten\Source\Repos\Allego.Testing.NUnit.Coverage\SimpleTestProject\bin\Debug\net461\SimpleTestProject.dll(.NETFramework,Version=v4.6.1)
Microsoft (R) Test Execution Command Line Tool Version 15.6.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
NUnit Adapter 3.10.0.21: Test execution started
Running all tests in C:\Users\Maarten\Source\Repos\Allego.Testing.NUnit.Coverage\SimpleTestProject\bin\Debug\net461\SimpleTestProject.dll
NUnit3TestExecutor converted 2 of 2 NUnit test cases
NUnit Adapter 3.10.0.21: Test execution complete
Failed   FailingTest
Error Message:
   Expected: True
  But was:  False

Stack Trace:
   at SimpleTestProject.Tests.FailingTest()


Total tests: 2. Passed: 1. Failed: 1. Skipped: 0.
Test Run Failed.
Test execution time: 1,4818 Seconds

However, when I use /p:CollectCoverage=true, I get the following output:

Build started, please wait...
Build completed.

Test run for C:\Users\Maarten\Source\Repos\Allego.Testing.NUnit.Coverage\SimpleTestProject\bin\Debug\net461\SimpleTestProject.dll(.NETFramework,Version=v4.6.1)
Microsoft (R) Test Execution Command Line Tool Version 15.6.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
An exception occurred while invoking executor 'executor://nunit3testexecutor/': Exception has been thrown by the target of an invocation.
Could not load file or assembly 'coverlet.core, Version=1.0.2.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)

Kind regards,

Maarten van Sambeek

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:10

github_iconTop GitHub Comments

3reactions
tonerdocommented, May 11, 2018

Working to fix this over the weekend

2reactions
tonerdocommented, Apr 14, 2018

Will explore signing the assembly. Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Missing strong name when using nunit3testexecutor #40
I'm trying to use coverlet with the NUnit3TestAdapter package. ... Missing strong name when using nunit3testexecutor #40.
Read more >
How to fix "Referenced assembly does not have a strong ...
The solution was to install StrongNamer from NuGet, which automatically adds a strong name to all referenced assemblies. Just simply having it ...
Read more >
Solving Long, flaky testing with Azure DevOps - Tsuyoshi Ushio
There are a number of ways to sign an assembly with a strong name: docs.microsoft.com ... An exception occurred while invoking executor ...
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 >
.NET NUnit Parallel Tests: Incorrect format for TestCaseFilter ...
It seems it can't deal with it. The thing is, parallel tests feature work based on accumulated test statistics on the TeamCity server....
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