为什么bindingRedirect不影响FSharp.Core版本 [英] Why doesn't bindingRedirect affect FSharp.Core version
问题描述
我有一个针对F#运行时4.4.1的单元测试项目.它有一个带有bindingRedirect部分的app.config:
I have a unit test project that targets F# runtime 4.4.1. It has an app.config with the bindingRedirect section:
<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>
但是,当我运行测试时,出现运行时错误:
However, when I run tests I get a runtime error:
无法加载文件或程序集'FSharp.Core,版本= 4.3.0.0, 文化=中性,PublicKeyToken = b03f5f7f11d50a3a'或其中之一 依赖关系.系统找不到指定的文件.
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.
我想知道为什么由于bindingRedirect指定了不同的版本而试图加载FSharp.Core 4.3.0.0.
I wonder why there is an attempt to load FSharp.Core 4.3.0.0 since bindingRedirect specifies a different version.
推荐答案
显然,这是XUnit配置的问题. app.config中的以下部分更改了AppDomain配置:
Apparently this is a problem with XUnit configutaration. The following section in app.config changed AppDomain configuration:
<appSettings>
<add key="xunit.appDomain" value="required" />
</appSettings>
然后,测试跑步者抱怨缺少xunit.execution.desktop.dll.一旦将文件放置在执行目录中,XUnit运行器就会通过bindingRedirect设置来赞扬app.config.
Then the test runner complained about missing xunit.execution.desktop.dll. Once the file was placed in the execution directory, XUnit runner honored app.config with bindingRedirect settings.
这篇关于为什么bindingRedirect不影响FSharp.Core版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!