f# - FSharp.核心 : Could not load file or assembly

标签 f#

尝试运行测试时出现以下错误:

{System.IO.FileLoadException: Could not load file or assembly 'FSharp.Core, Version=3.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'FSharp.Core, Version=3.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at Register.RegisterResponse.__DebugDisplay()

Tests.dll

FSharp.Core: 3.1.2.5

目标 F# 运行时:4.3.1.0

目标框架:4.6

输出类型:类库

ManageAccount.dll

FSharp.Core: 3.1.2.5

目标 F# 运行时:3.3.1.0

目标框架:.NET 可移植子集(.Net Framework 4.5、ASP.Net Core 1.0、Windows 8)

输出类型:类库

然后我将以下应用配置添加到我的测试项目中:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a"
                          culture="neutral"/>
        <bindingRedirect oldVersion="3.1.2.5" newVersion="3.3.1.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

如果我确实需要应用配置,我的 bindingRedirect 应该设置什么值?

最佳答案

尝试 <bindingRedirect oldVersion="0.0.0.0-999.999.999.999" newVersion="3.3.1.0" /> .这就是大多数 F# 项目似乎正在为 FSharp.Core 做的事情。 (或者 newVersion="4.3.1.0" ,甚至是 newVersion="4.4.0.0" 如果您升级到更新的 FSharp.Core)。

关于f# - FSharp.核心 : Could not load file or assembly,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39206991/

相关文章:

f# - Seq.map中的代码没有执行?

f# - 如何使Canopy的Live HtmlReporter工作?

matlab - 如何将 F# Seq 转换为 MWArray

asynchronous - "Throttled"在 F# 中异步下载

f# - .fsproj文件的#I等效项是什么?

f# - 您如何在 F# 或任何函数式语言中对第二个(或第三个、第四个、...)参数进行 curry?

f# - 定义中出现意外的关键字 'val'

F#,sprintf "%A"在歧视联合上的表现

.net - 理解byref、ref和&

visual-studio - F# Visual Power Tools 不起作用