0

I am trying to run unit tests in a C# project that I have been working on, I have it in a repository in github and I cloned that repository to a desktop machine after creating it on my laptop.

When I try to run the unit tests I get this message in the console.

No test is available in C:\source\repos\server.csproj C:\source\repos\UnitTests\UnitTests.csproj. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.

The paths here have been anonymized.

I am suspicious that I inappropriately included a file in my gitignore, but not sure it that is actually the case or what file might have been ignored incorrectly. I used a sample that is available on github and haven't modified it.

Has anybody run into this and have any advice on how to fix it?

morris295
  • 517
  • 1
  • 7
  • 21

1 Answers1

3

Make sure the test settings matches your processor architecture.

enter image description here

Connell.O'Donnell
  • 3,603
  • 11
  • 27
  • 61
  • So in my reply to your comment I had checked this, but I compared it to the unit test project properties as well and assumed that the target processor there and this option were related. Additionally, on my laptop where I created the project x86 is selected and the tests run without any problem. I switched the default processor architecture to x64 on the desktop where I cloned this project and the unit tests are identified and run there fine now. I'm not sure I understand why this is, both machines have 64 bit processors. Regardless, thanks for your help. – morris295 Nov 28 '18 at 19:55
  • The answer linked below explicitly indicates that if the target platform in the project properties is set to x64 then the default processor architecture needs to match. The target platform in my test project is set to "Any CPU" so I'm even more uncertain why this would need to be changed in my case. https://stackoverflow.com/a/50571848/1499043 – morris295 Nov 28 '18 at 20:04