dotnet-test-nunit icon indicating copy to clipboard operation
dotnet-test-nunit copied to clipboard

Cannot run NUnit with ReSharper

Open tpluscode opened this issue 8 years ago • 4 comments

Sorry if this is not the right place to ask. I'm converting a project to project.json and dotnet test works fine in console. I updated to R# 2016.3.2 and my tests are discovered in VS. Unfortunately I cannot run them. When I try, no tests are executed and the Unit Test Session window displays an exception stack trace:

ERROR System.AggregateException: One or more errors occurred. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at JetBrains.ReSharper.UnitTestFramework.Launch.Stages.DiscoveryStage.Run(CancellationToken token)
   at JetBrains.ReSharper.UnitTestFramework.Launch.UnitTestLaunch.RunStage(Object stageObject)
---> (Inner Exception #0) System.Threading.Tasks.TaskCanceledException: A task was canceled.<---

My project.json is as follows (relevant parts):

{
 "dependencies": {
    "NUnit": "3.6.1",
    "dotnet-test-nunit": "3.4.0-*"
  },
  "testRunner": "nunit"
}

Is there anything I can try?

tpluscode avatar Feb 28 '17 20:02 tpluscode

This might be https://youtrack.jetbrains.com/issue/RSRP-461908

jnm2 avatar Feb 28 '17 20:02 jnm2

Wait- you're converting to project.json, not from project.json?

If you're converting a .NET Framework (not .NET Core) .csproj from packages.config (NuGet v2) to project.json (NuGet v3), 2017.1 EAP 2 is the first version of ReSharper that has worked for me for months.

jnm2 avatar Feb 28 '17 20:02 jnm2

Unfortunately EAP 3 doesn't work either :(. Same error.

tpluscode avatar Mar 01 '17 19:03 tpluscode

Your project.json looks like you're running .NET Core. Is that correct? Be aware that project.json's official replacement is being released on the 7th with VS2017's RTM, a new .csproj format for both .NET Core and .NET Framework where no project.json file is used.

jnm2 avatar Mar 05 '17 01:03 jnm2