NUnit Tests Not Running

Error

2020.07.15 10:05:30.053 ERROR System.TypeLoadException: Method 'get_AssemblyPath' in type 'NUnit.Engine.Extensibility.ExtensionNode' from assembly 'nunit.engine, Version=3.10.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb' does not have an implementation.
System.TypeLoadException: Method 'get_AssemblyPath' in type 'NUnit.Engine.Extensibility.ExtensionNode' from assembly 'nunit.engine, Version=3.10.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb' does not have an implementation.
at NUnit.Engine.Services.ExtensionService..ctor()
at NUnit.Engine.TestEngine.Initialize()
at NUnit.Engine.TestEngine.GetRunner(TestPackage package)
at JetBrains.ReSharper.UnitTestRunner.nUnit30.NUnitRunner.Run(String assembly, IDictionary`2 testParameters) in /Product.Root/Psi.Features/UnitTesting/nUnit/Runner30/Src/NUnitRunner.cs:line 41
at JetBrains.ReSharper.UnitTestRunner.nUnit30.BuiltInNUnitRunner.WithExtensiveErrorHandling(IRemoteTaskServer server, Action action) in /Product.Root/Psi.Features/UnitTesting/nUnit/Runner30/Src/BuiltInNUnitRunner.cs:line 73

2020.07.15 10:05:30.092 WARN Element AutoEntry.SDK.Tests.Class2.InitClass was left pending after its run completion.

 

csproj

 

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

  <PropertyGroup>

    <TargetFrameworks>net461;netcoreapp3.1</TargetFrameworks>

  </PropertyGroup>

 

  <ItemGroup>

    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />

    <PackageReference Include="NUnit" Version="3.12.0" />

    <PackageReference Include="NUnit.Console" Version="3.11.1" />

    <PackageReference Include="NUnit.ConsoleRunner" Version="3.11.1" />

    <PackageReference Include="NUnit3TestAdapter" Version="3.17.0">

      <PrivateAssets>all</PrivateAssets>

      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

    </PackageReference>

    <PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />

  </ItemGroup>

</Project>
5
10 comments
Official comment

Dear folks! 

We have this issue fixed in Rider and ReSharper 2020.2 EAP builds. So, please download and install them and check the issue once again:

- ReSharper 2020.2 EAP https://www.jetbrains.com/resharper/nextversion

- Rider 2020.2 EAP https://www.jetbrains.com/rider/nextversion

Thanks!

I have the same issue since yesterday, did you find a solution ?

0

Same for me on Rider 2020.1.

0

EAP 6 works.

1

Same issue, removing 'NUnit3TestAdapter' was a valid workaround for me. 

5

I had same problem when I ran tests in Rider. I cleaned all of NuGet cache and .idea folders, and it fixed.

 

0

The problem seems to occur when NUnit3TestAdapter copies the following files into the build output directory:

  • nunit.engine.api.dll
  • nunit.engine.dll

and when I run VS in the debugger, I see that nunit.engine.api.dll has been loaded from the output directory (the one copied by NUnit3TestAdapter), and nunit.engine.dll has been loaded from R#'s installation directory.

If I change the package reference to:

<PackageReference Include="NUnit3TestAdapter" Version="3.17.*" PrivateAssets="all"
Condition="'$(TargetFramework)' == 'netcoreapp3.1'" />

then for me it still runs the .NET Framework tests as expected, and it can also run the .NET Core tests successfully.

0

Hi Team R# 👋

Came across this issue when someone reported the bug over at NUnit - I've posted my thoughts on what's going on in the issue below, if they're helpful. 

https://github.com/nunit/nunit-console/issues/800

Please shout if we over at NUnit can help at all!

Thanks,

Chris - NUnit Team 

0

EAP 8 works for me. I'm running tests in net462 and netcoreapp3.1.

0

Please sign in to leave a comment.