8

While the tests worked fine on friday I now get this error:

enter image description here

When I look at xUnit's github it's clear that this fails on xUnit code:

enter image description here

The GetTestCases code does this:

enter image description here

So, as I read it, and as I would expect, the test assembly is read for matches, which for some reason suddenly fails, while being just fine on friday.

I've tried another solution, it's tests run just fine.

What I've tried

  • Clean / rebuild solution
  • Manually remove bin obj folders
  • Uninstall and install package xunit (version 2.2.0)
  • Shut down / restart Visual Studio
  • Reboot laptop

None of this helps, nor did updating ReSharper.

What's going on and what can fix this?

Possibly ReSharper is interfering somehow?

Spikee
  • 3,967
  • 7
  • 35
  • 68
  • 1
    Have you tried pressing the 'Clear caches' under `Resharper`->`Settings...`->`Environment`->`General`? – Piers Myers Jun 19 '17 at 08:47
  • I have now, sadly no difference. – Spikee Jun 19 '17 at 08:53
  • 1
    What are the versions of ReSharper and .net core? What are you trying to run - all tests in solution, or re-run an existing session? What do you see in the Unit Test Explorer tool window (not the Sessions tool window)? And have you tried clicking the "OK" or "Error" message in the right hand side of the Sessions tool window? This should show a log of what's happening. – citizenmatt Jun 19 '17 at 13:06
  • @citizenmatt I've fixed the issue in the meantime by going back to the previous commit and adding what was missing from the (now erroneous) newer branch in the meantime, but what you say sounds interesting, I'll check! – Spikee Jun 19 '17 at 13:44

1 Answers1

6

My problem was, that the Unit Test project created in VS2017 (v15.2) did not have some specific assemblies reference. After every failed run attempt I just went through Output:Tests window a check for any exception. Exceptions were complaining about missing assembly references: System.Runtime, System.Runtime.Extensions, System.Reflection. System.Linq

Once I have added all the references(NuGets) all works as intended.

I'm using VS2017, SpecFlow(2.2.0), xUnit(2.2.0), .NET 4.7, R#(2017.1.3)

Skorunka František
  • 5,102
  • 7
  • 44
  • 69
  • Thank you for your insights here! I am having these kinds of issues since upgrading to .NET 4.7. The questions that are concerning me: Why has it worked before? Why are these problems only occuring at runtime and not at compile time? – timmkrause Oct 04 '17 at 14:27