Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 301
Pouya Yousefi Avatar asked Nov 24 '15 04:11

Pouya Yousefi


3 Answers

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.

like image 167
Stephen Avatar answered Nov 16 '22 06:11

Stephen


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

like image 26
Evan M Avatar answered Nov 16 '22 07:11

Evan M


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.
like image 4
Kristopher Johnson Avatar answered Nov 16 '22 08:11

Kristopher Johnson