在 Fitnesse 中运行测试给出:
无法完成测试:fitnesse.slim.SlimError:错误 SLiM 服务器在可以读取标头消息之前死亡。
当使用 Slim RunnerW.exe 调试我的测试时,我得到一个异常:
System.BadImageFormatException
: 无法加载文件或程序集 'file:///c:\path\assemby.exe' 或其依赖项之一。该模块应包含程序集清单。
我使用 ProcessExplorer 检查 RunnerW.exe 以 64 位模式运行。我的代码是用“任何 CPU”编译的,与另一个工作项目的唯一区别是它是一个使用 FitSharp 2.8.2.1 NuGet 包的 .net 5(核心)项目。
启用 FusionLog 后,很明显它无法加载我的主要测试程序集。这是日志的一部分:
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Attempting download of new URL file:///C:/path/assembly.exe.
LOG: Assembly download was successful. Attempting setup of file: C:\path\assembly.exe
LOG: Entering run-from-source setup phase.
ERR: Error extracting manifest import from file (hr = 0x80131018).
ERR: Run-from-source setup phase failed with hr = 0x80131018.
ERR: Failed to complete setup of assembly (hr = 0x80131018). Probing terminated.
我认为它正在尝试将 .Net 5 程序集加载到 .Net 4 进程中?
任何想法如何解决这个问题?我想添加一个 app.config 文件并指定一个运行时,但我不确定,它可能只是一个兔子洞,因为我们似乎需要在这里混合框架?