JetBrains Resharper 9 Ultimate Test Runner error: NUnit.Core.UnsupportedFrameworkException: Skipped loading assembly {MyAssembly}
Asked Answered
D

5

40

This seems to be an error with the JetBrains Resharper 9.1 Ultimate Test Runner referencing an older version of NUnit. I am using NUnit 3.0 in my assembly.

[Window Title]
Unit Test Runner

[Main Instruction]
Unit Test Runner failed to run tests

[Expanded Information]
at NUnit.Core.Builders.TestAssemblyBuilder.GetCandidateFixtureTypes(Assembly assembly, String ns)
at NUnit.Core.Builders.TestAssemblyBuilder.GetFixtures(Assembly assembly, String ns)
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites)
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites)
at NUnit.Core.TestSuiteBuilder.Build(TestPackage package)
at NUnit.Core.SimpleTestRunner.Load(TestPackage package)
at NUnit.Core.ProxyTestRunner.Load(TestPackage package)
at NUnit.Core.RemoteTestRunner.Load(TestPackage package)
at JetBrains.ReSharper.UnitTestRunner.nUnit.BuiltInNUnitRunner.RunTests(IRemoteTaskServer server, Dictionary`2 tests, Dictionary`2 fixtures, List`1 explicitly, Boolean useAddins, List`1 assemblies)

EDIT: Problem goes away with upgrade to version 10 of Resharper.

Desertion answered 24/11, 2015 at 4:40 Comment(0)
R
15

As Yousefi mentioned, this is fixed by updating to version 10 of ReSharper. I had the same issue and that resolved it.

Reenter answered 1/12, 2015 at 0:31 Comment(7)
Unfortunately not.. I did a fresh install of resharper 10 ultimate but the problem remains the same.Talkington
@rob I also had to restart Visual Studio. Did you try that?Reenter
good point. Probably didn't because I've just updated. I'll try that out later today.Talkington
Would like to point out that "Upgrading to Resharper 10" is not an acceptable fix for this issue. This is only possible if your license allows this. There should be a better solution that works on 9.1 as well. I'm using version 9.2 and have encountered the same issue. VS2015Symposiarch
Downgrading nunit to a pre-3.0 version seems to do the trick. Although this is also not an acceptable solution to me, it is one that everyone can do.Symposiarch
A clearer error message would be nice, but it's fair for JetBrains to require an upgrade - we can't expect them to support all future versions of NUnit in old versions of ReSharper indefinitely.Reenter
The worst is, that it actually worked in VS2013 with Resharper 8 and does NOT work in VS2015 with Resharper 9...Metaphor
P
27

As mentioned in the accepted answer, ReSharper 9 does not support NUnit 3. The solution as stated does work (i.e. update to ReSharper 10), however, for those who do not have this option (e.g. licensing), you can downgrade your version of NUnit by following the below steps:

  1. Open Nuget Package Manager Console by going to Tools -> Nuget Package Manager -> Package Manager Console
  2. In the console that pops up (usually at the bottom), under the dropdown for "Default project:" choose the test project you wish to downgrade
  3. Run the following commands Uninstall-Package NUnit followed by Install-Package NUnit -Version 2.6.4

Your tests should now run using ReSharper 9.

Persis answered 13/3, 2016 at 2:30 Comment(0)
R
15

As Yousefi mentioned, this is fixed by updating to version 10 of ReSharper. I had the same issue and that resolved it.

Reenter answered 1/12, 2015 at 0:31 Comment(7)
Unfortunately not.. I did a fresh install of resharper 10 ultimate but the problem remains the same.Talkington
@rob I also had to restart Visual Studio. Did you try that?Reenter
good point. Probably didn't because I've just updated. I'll try that out later today.Talkington
Would like to point out that "Upgrading to Resharper 10" is not an acceptable fix for this issue. This is only possible if your license allows this. There should be a better solution that works on 9.1 as well. I'm using version 9.2 and have encountered the same issue. VS2015Symposiarch
Downgrading nunit to a pre-3.0 version seems to do the trick. Although this is also not an acceptable solution to me, it is one that everyone can do.Symposiarch
A clearer error message would be nice, but it's fair for JetBrains to require an upgrade - we can't expect them to support all future versions of NUnit in old versions of ReSharper indefinitely.Reenter
The worst is, that it actually worked in VS2013 with Resharper 8 and does NOT work in VS2015 with Resharper 9...Metaphor
N
4

As mentioned in the other answer, the real fix is to upgrade to ReSharper 10. But if you can't do that, you can disable ReSharper 9's unit-test functionality and fall back to Visual Studio's built-in Test Explorer.

To do this:

  1. Choose the ReSharper > Options... menu item, go to the Unit Testing panel, and uncheck the Enable Unit Testing box.
  2. Restart Visual Studio.
  3. Use the Test > Windows > Test Explorer menu item to display Visual Studio's Test Explorer.
Nuptials answered 25/2, 2016 at 22:42 Comment(2)
that worked, except there was no tests in the test explorer, instead I right clicked the project and selected "run all unit tests" ( I have VS2015 and resh 10)Cambric
You need to ensure you install the NUnitTestAdaptor extension into Visual Studio as by default VS only displays MSTest unit tests.Sidelong
S
4

What worked for me (VS 2015):

1) installed NUnit Test Adapter 3.2

2) opened Test Explorer: VS -> menu Test -> Windows -> Test Explorer

3) ran test: In Test Explorer window (if no test, rebuild solution) selected test to run, right clicked and "Run Selected Tests"

voila I can see the test in Test Explorer window and select one and debug it.

Stringency answered 11/8, 2016 at 12:23 Comment(1)
In my case, Visual Studio had disabled the NUnit Test Adapter (3.7) and I could not re-enable it (I restarted VS as suggested, but it didn't work) so I had to uninstall the extension, restart VS, and reinstall the extension, and restart VS again, then it worked.Latty
U
0

Going into the ReSharper v10 Options screen, under Tools | Unit Testing | NUnit, there is an option setting for When to use NUnit 3 test runner. Setting this to Always resolved the problem for me. The error message shown above no longer appears after making this change.

Unable to run NUnit's unit tests with ReSharper's test runner

Upsilon answered 2/1, 2017 at 9:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.