Coverlet: Missing strong name when using nunit3testexecutor

Created on 12 Apr 2018  路  10Comments  路  Source: coverlet-coverage/coverlet

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

bug in progress

Most helpful comment

Working to fix this over the weekend

All 10 comments

Will explore signing the assembly. Thanks

Any update on this issue? I'm also affected by this.

+1!

Working to fix this over the weekend

I found this work-around for the time being.

@tonerdo: Any update on this?

Coverlet has been signed and a new release made available: https://www.nuget.org/packages/coverlet.msbuild/2.0.1

@basilfx @MaartenX did 2.0.1 fix this?

Yes, this seems to work for me.

Awesome. Will close this out, feel free to reopen if you encounter any more issues on this topic

Was this page helpful?
0 / 5 - 0 ratings