Question Details

No question body available.

Tags

c# mstest .net-8.0 rider

Answers (1)

July 16, 2026 Score: 5 Rep: 415 Quality: Medium Completeness: 60%

Found the cause: it was a platform architecture mismatch between Rider's test runner and the project's forced x64 target.

My .csproj explicitly sets:


  x64

Rider's own setting for "Default platform architecture" (under Settings → Build, Execution, Deployment → Unit Testing) was not aligned with this x64 requirement. Rider's internal test host (based on JetBrains.ReSharper.TestRunner) starts its own process using that default architecture setting — if it doesn't match the project's PlatformTarget, the test host can't load the compiled assembly, even though the DLL physically exists on disk. That's why dotnet test (which resolves architecture automatically per project) worked fine, while Rider's internal runner failed with FileNotFoundException.

Fix:

Go to Settings → Build, Execution, Deployment → Unit Testing.

Set "Default platform architecture" to x64 (matching the PlatformTarget in the .csproj).

Restart the test session (no cache invalidation or rebuild needed once this is set correctly).

After that, tests are discovered and run correctly inside Rider, matching the console dotnet test behavior.