Missing strong name when using nunit3testexecutor
See original GitHub issueI’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:
- Created 5 years ago
- Reactions:2
- Comments:10
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Working to fix this over the weekend
Will explore signing the assembly. Thanks