为什么 bindingRedirect 不影响 FSharp.Core 版本

Why doesn't bindingRedirect affect FSharp.Core version

我有一个针对 F# 运行time 4.4.1 的单元测试项目。它有一个 app.config 和 bindingRedirect 部分:

  <dependentAssembly>
    <Paket>True</Paket>
    <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.4.1.0" />
  </dependentAssembly>

但是,当我 运行 测试时,出现 运行 时间错误:

Could not load file or assembly 'FSharp.Core, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

我想知道为什么会尝试加载 FSharp.Core 4.3.0.0,因为 bindingRedirect 指定了不同的版本。

显然这是 XUnit 配置的问题。 app.config 中的以下部分更改了 AppDomain 配置:

  <appSettings>
    <add key="xunit.appDomain" value="required" />
  </appSettings>

然后测试跑者抱怨缺少xunit.execution.desktop.dll。一旦文件被放置在执行目录中,XUnit runner 就会使用 bindingRedirect 设置 app.config。