Resharper error when running unit tests with nunit 3
Somewhere in the middle of running tests in Resharper 2016.3.2, I'm getting an error that skips all the subsequent tests. I haven't been able to isolate if a specific test is causing the issue, because when I remove too many tests, then everything passes. If I run the removed tests, they also pass without issues.
The error is as follows:
2017.05.12 14:11:45.952 ERROR System.IO.FileNotFoundException: Could not load file or assembly 'file:///D:\_dist\src\mysolution\myproject\bin\Debug\JetBrains.ReSharper.UnitTestRunner.nUnit30.dll' or one of its dependencies. The system cannot find the file specified.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTaskRunner.SetupRunnerAssembly(NUnitVersion nUnitVersion)
at JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTaskRunner.SetUpNUnitRunner(NUnitVersion version, String nUnitInstallDir)
at JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTaskRunner.RunTestsInAssemblies(List`1 assemblies, NUnitTestAssemblySetTask assemblySetTask, Boolean useAddins, NUnitVersion nUnitVersion)
at JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTaskRunner.ExecuteRecursive(TaskExecutionNode node)
at JetBrains.ReSharper.TaskRunnerFramework.StartupTaskRunnerHost.Execute(TaskExecutionNode node)
at JetBrains.ReSharper.TaskRunnerFramework.StartupTaskRunnerHost.ExecuteNodes(IEnumerable`1 nodes)
at JetBrains.ReSharper.TaskRunnerFramework.TasksPacketHandler.ThreadProc(TaskRunnerProxy proxy, IEnumerable`1 packets, AssemblyLoader loader)
Does anyone know how to resolve this issue?
Please sign in to leave a comment.
If anyone runs into something like this, then check to make sure that nobody is adjusting System.Environment.CurrentDirectory. That's what was happening to me.