Skip to content

Missing strong name when using nunit3testexecutor #40

@MaartenX

Description

@MaartenX

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions