Resharper and Visual Studio ignoring my NUnit test
I had a weird one today, some things should just work but they don't and I was creating a brand new unit test project in DotNet core to test a DotNet core api controller. I added NUnit, added a simple test and when I tried to run it, it showed as ignored.
I added another even simpler test that did nothing and the same thing happened.
I then found appalling complicated complaints about the various combinations of NUnit, VSTest, DotNet Core and basically my heart sank as I thought I was fighting a losing battle against something that really should just work.
The main issue was around the various strange error messages, which did not make any sense to me and included:
Anyway, after one of my combinations, I noticed a message telling me there was an error and to look in the test output window. I assumed they meant the output window (they did) and then I saw this:
I did this and finally everything cranked back into life.
It's these basics that I often moan about because somebody with less experience than me would have bailed a long time before I did. I was only committed because I had already built the target project and need unit tests. If I didn't, I would simply tell everyone that .Net is a nightmare and the MS teams seem unable to keep the quality in their releases.
I added another even simpler test that did nothing and the same thing happened.
I then found appalling complicated complaints about the various combinations of NUnit, VSTest, DotNet Core and basically my heart sank as I thought I was fighting a losing battle against something that really should just work.
The main issue was around the various strange error messages, which did not make any sense to me and included:
- test case objects missing for the following elements
- ignored: vstest test-case is missing
Anyway, after one of my combinations, I noticed a message telling me there was an error and to look in the test output window. I assumed they meant the output window (they did) and then I saw this:
- Testhost process exited with error: It was not possible to find any compatible framework version
The specified framework 'Microsoft.AspNetCore.App', version '2.2.5' was not found.
I did this and finally everything cranked back into life.
It's these basics that I often moan about because somebody with less experience than me would have bailed a long time before I did. I was only committed because I had already built the target project and need unit tests. If I didn't, I would simply tell everyone that .Net is a nightmare and the MS teams seem unable to keep the quality in their releases.