Resharper 错误 运行 nunit 在任何 CPU 模式下测试解决方案

Resharper error running nunit tests for solution in Any CPU mode

我在针对任何 CPU 时对我的解决方案进行 resharper 测试时遇到问题 运行。我得到的错误是

ERROR System.IO.FileNotFoundException: Could not load file or assembly 'file:///D:_dist\path\to\my\bin\folder\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(List1 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(IEnumerable1 nodes) at JetBrains.ReSharper.TaskRunnerFramework.TasksPacketHandler.ThreadProc(TaskRunnerProxy proxy, IEnumerable`1 packets, AssemblyLoader loader)

当我将解决方案转换为 x86 时,测试 运行(但因为这些测试 运行 对于其他使用 Resharper 的人来说很好,我不能直接在解决方案中创建 x86 配置).

有人知道问题出在哪里吗?我正在 运行ning VS2015,Resharper 2016.3.2,解决方案是 c#/asp.net mvc 解决方案,带有 Service Fabric 微服务(另一个原因我宁愿不求助于切换到 x86 到 运行 测试)。

非常感谢任何帮助。

如果有人遇到这个问题,这个错误应该会让您想到尝试弄清楚为什么它会尝试从您的项目 bin 文件夹加载 ReSharper dll。

看起来 ReSharper 使用 System.Environment.CurrentDirectory 来获取它的 dll,因此当有人在其中一项测试中更改值时,当 ReSharper 需要访问 nunit 运行器时它会破坏后续的值。