Error trying to run XUnit

Hello, i'm using Rider 2022.2.3 and i'm on aNetCore 6.0 project. When i try to run any unit tests i get the following error:





Unfortunately, it's impossible to discover unit tests in some of your projects. :(
Below you can find the error details for each project.

Project: Database.Tests (C:\Users\sross\source\repos\insoluti\jarvis\bin\net6.0\Database.Tests.dll)
(+0 -0 ~0)
Exception occurred during exploration.
JetBrains.ReSharper.UnitTestFramework.Common.Exceptions.ProcessExitedUnexpectedlyException: Test runner agent exited unexpectedly
---> JetBrains.ReSharper.UnitTestFramework.Common.Exceptions.UnknownExitCodeException: Process C:\Users\sross\AppData\Local\JetBrains\Rider\r2r\2022.2.3.0.0R\D8E8B19C88B26516B635ADF451BDDA0\TestRunner\netcoreapp3.0\ReSharperTestRunner.exe:26468 exited with code '-2147450740':
Error:
An assembly specified in the application dependencies manifest (Database.Tests.deps.json) was not found:
package: 'Microsoft.AspNetCore.TestHost', version: '6.0.7'
path: 'lib/net6.0/Microsoft.AspNetCore.TestHost.dll'
--- End of inner exception stack trace ---
at JetBrains.ReSharper.UnitTestFramework.Execution.TestRunner.Activation.TestRunnerAgent.AnalyseExitCode(IPreparedProcess process)
at JetBrains.ReSharper.UnitTestFramework.Execution.TestRunner.Activation.TemporaryTestRunnerAgentInvoker.<>c__DisplayClass3_1.<StartTestRunnerAgent>b__3()
at JetBrains.ReSharper.UnitTestFramework.Common.Extensions.TaskExtensions.ThrowIf[TResult,TException](Task`1 task, WaitHandle waitHandle, Func`1 exceptionFactory)
at JetBrains.ReSharper.UnitTestFramework.Execution.TestRunner.Activation.TemporaryTestRunnerAgentInvoker.StartTestRunnerAgent(ITestRunnerContext ctx, CancellationToken ct)
at JetBrains.ReSharper.UnitTestFramework.Execution.TestRunner.TestRunnerAgentManager.GetDiscoveryAgent(ITestRunnerDiscoveryContext context, CancellationToken ct)
at JetBrains.ReSharper.UnitTestFramework.Exploration.Artifacts.UnitTestExplorerFrom.TestRunner.ProcessProject(IUnitTestElementObserver observer, CancellationToken token)
at JetBrains.ReSharper.UnitTestFramework.Exploration.Artifacts.UnitTestExplorerFrom.DotNetArtifacts.Async.ProcessArtifact(IUnitTestElementObserver observer, CancellationToken token)

1
3 comments

Hello S Rossi,

Try adding an explicit reference of `Microsoft.AspNetCore.TestHost.dll` to the "Database.Tests" project.

0

unfortunatelly the reference is already there.

0

Hi S Rossi,

Please collect the logs according to How to enable Unit Tests runner's logging – Rider Support | JetBrains

Upload the resulted archive to Uploads Service and share the Upload ID.

Thank you!

0

Please sign in to leave a comment.