TestRunner: Application JetBrains.Rd.Tasks.RdFault

Answered

When running unit tests with ReSharper I'm getting the below exception. The tests run fine with Visual Studio's native test runner.

I am using Visual Studio 2019 16.7.2 and ReSharper 2020.2.4.

The tests are running .NET Core 3.1.

ERROR TestRunner: Application JetBrains.Rd.Tasks.RdFault: Could not load type 'System.AppDomainSetup' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'., reason: System.TypeLoadException: Could not load type 'System.AppDomainSetup' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at Xunit.AppDomainManager_AppDomain.CreateAppDomain(String assemblyFilename, String configFilename, Boolean shadowCopy, String shadowCopyFolder) at Xunit.DiaSessionWrapper..ctor(String assemblyFilename) in C:\Dev\xunit\xunit\src\xunit.runner.utility\Utility\DiaSessionWrapper.cs:line 15 at Xunit.XunitFrontController..ctor(AppDomainSupport appDomainSupport, String assemblyFileName, String configFileName, Boolean shadowCopy, String shadowCopyFolder, ISourceInformationProvider sourceInformationProvider, IMessageSink diagnosticMessageSink) in C:\Dev\xunit\xunit\src\xunit.runner.utility\Frameworks\XunitFrontController.cs:line 70 at JetBrains.ReSharper.TestRunner.Adapters.XUnit.XUnitRunner.GetXUnitController(TestRunRequest request) in C:\work\dotnet-libs\ReSharperTestRunner\src\Adapters\TestRunner.Adapters.XUnit\XUnitRunner.cs:line 60 at JetBrains.ReSharper.TestRunner.Adapters.XUnit.XUnitRunner.RunTests(TestRunRequest request, ITestDiscoverySink discoverySink, ITestExecutionSink executionSink) in C:\work\dotnet-libs\ReSharperTestRunner\src\Adapters\TestRunner.Adapters.XUnit\XUnitRunner.cs:line 38 at JetBrains.ReSharper.TestRunner.Implementation.UnitTestRemoteAgent.Execute(TestRunRequest request) at JetBrains.ReSharper.TestRunner.Implementation.ClientEndpoint.<>c__DisplayClass4_1.<TryRegisterHandler>b__1() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) --- End of stack trace from previous location where exception was thrown --- at JetBrains.ReSharper.TestRunner.Implementation.ClientEndpoint.RunAndLog(Func`2 handler, IAutoRegisterInProtocol message)

--- EXCEPTION #1/1 [LoggerException]
Message = “
TestRunner: Application JetBrains.Rd.Tasks.RdFault: Could not load type 'System.AppDomainSetup' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'., reason: System.TypeLoadException: Could not load type 'System.AppDomainSetup' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
at Xunit.AppDomainManager_AppDomain.CreateAppDomain(String assemblyFilename, String configFilename, Boolean shadowCopy, String shadowCopyFolder)
at Xunit.DiaSessionWrapper..ctor(String assemblyFilename) in C:\Dev\xunit\xunit\src\xunit.runner.utility\Utility\DiaSessionWrapper.cs:line 15
at Xunit.XunitFrontController..ctor(AppDomainSupport appDomainSupport, String assemblyFileName, String configFileName, Boolean shadowCopy, String shadowCopyFolder, ISourceInformationProvider sourceInformationProvider, IMessageSink diagnosticMessageSink) in C:\Dev\xunit\xunit\src\xunit.runner.utility\Frameworks\XunitFrontController.cs:line 70
at JetBrains.ReSharper.TestRunner.Adapters.XUnit.XUnitRunner.GetXUnitController(TestRunRequest request) in C:\work\dotnet-libs\ReSharperTestRunner\src\Adapters\TestRunner.Adapters.XUnit\XUnitRunner.cs:line 60
at JetBrains.ReSharper.TestRunner.Adapters.XUnit.XUnitRunner.RunTests(TestRunRequest request, ITestDiscoverySink discoverySink, ITestExecutionSink executionSink) in C:\work\dotnet-libs\ReSharperTestRunner\src\Adapters\TestRunner.Adapters.XUnit\XUnitRunner.cs:line 38
at JetBrains.ReSharper.TestRunner.Implementation.UnitTestRemoteAgent.Execute(TestRunRequest request)
at JetBrains.ReSharper.TestRunner.Implementation.ClientEndpoint.<>c__DisplayClass4_1.<TryRegisterHandler>b__1()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at JetBrains.ReSharper.TestRunner.Implementation.ClientEndpoint.RunAndLog(Func`2 handler, IAutoRegisterInProtocol message)

ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
at JetBrains.ReSharper.UnitTestFramework.TestRunner.Handlers.UnitTestRemoteAgentLoggingHandler.Execute(LogMessage message)
at lambda_method(Closure , IAutoRegisterInProtocol )
at JetBrains.ReSharper.UnitTestFramework.TestRunner.ServerEndpoint.<>c__DisplayClass7_1.<TryRegisterHandler>b__1()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
at System.Threading.Tasks.Task.ExecutionContextCallback(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()



0
4 comments
Official comment

Hello,

Please set the following setting ReSharper | Options | Tools | Unit Testing | General | "Default .NET Framework version:" to the "Automatic" value.

Also, the behavior is fixed in the 2020.3 and the setting different from "Automatic" doesn't affect running the tests in .NET Core projects.

Hello Richard J Hughes,

Thank you for contacting us! Do you test an UWP application by any chance? Could you get a ReSharper log and share it alongside a support ticket? You can create one by the "Submit a Request" button above.

Please run ReSharper with logging enabled, start VS devenv.exe executable with the following options, then reproduce the issue and share the C:\log\resharper_log.txt log file.

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\devenv.exe" /ReSharper.LogFile C:\log\resharper_log.txt /ReSharper.LogLevel Verbose
1

I've run into this issue as well and have submitted request 2997159 with the verbose logfile

0

Hello Andrey Simukov

Your suggestion to change the default .NET Framework Version to Automatic worked.

Thanks!

0

Please sign in to leave a comment.