Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JetBrains Rider unable to detect UnitTests

I am using JetBrains Rider to run unit tests for a .net Core project. And for some reason, it is failing to recognize any of the test cases in the solution.

These test cases were being detected before and now suddenly they are not. I restarted the Rider and rebuilt the solution and it seems that the problem does not go away.

Any suggestions on how to debug this?

like image 784
Lost Avatar asked Nov 20 '25 18:11

Lost


2 Answers

I had a similar problem with Rider 2023.1.3. Run/Debug Unit Test options were disabled for some test classes, besides these classes were not displayed in the Unit Tests Explorer and they are disappeared from test session.

File -> Invalidate Caches... and restarting of Rider resolved the problem.

like image 74
eugeny-pol Avatar answered Nov 23 '25 08:11

eugeny-pol


I had exactly this problem with Rider a while ago. My teammates could still run our NUnit tests (both in Rider and Visual Studio) but I couldn't. The Run Unit Tests menu items were all disabled and the run icons that usually appear in the left margin alongside the test fixture class and test methods didn't appear.

It turned out to be a bug in Rider causing an incompatibility between versions of .NET Core and the Microsoft.NET.Test.Sdk library. I'd run the Visual Studio Updater and my teammates hadn't, so I was on the latest version of .NET Core and they weren't.

Here's the bug I filed with JetBrains. As you can see, they migrated it to ReSharper but the bug affected Rider too. Although it was fixed at the time I think I've seen it again since.

To find out if you've got the same problem, try the following:

  • Make sure .NET (Core) and the Microsoft.NET.Test.Sdk library are both up-to-date.
  • If this doesn't work, downgrade Microsoft.NET.Test.Sdk to an older version (anything before 16.3.0 worked for me).
like image 28
Mark Whitaker Avatar answered Nov 23 '25 09:11

Mark Whitaker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!