FSharp.Core:无法加载文件或程序集 [英] FSharp.Core: Could not load file or assembly
问题描述
尝试运行测试时出现以下错误:
{System.IO.FileLoadException:无法加载文件或程序集 'FSharp.Core,版本= 3.3.1.0,文化=中性, PublicKeyToken = b03f5f7f11d50a3a'或其依赖项之一.这 定位的程序集的清单定义与程序集不匹配 参考. (来自HRESULT的异常:0x80131040)文件名: 'FSharp.Core,版本= 3.3.1.0,文化=中性, PublicKeyToken = b03f5f7f11d50a3a',位于 Register.RegisterResponse .__ DebugDisplay()
{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
FSharp.Core: 3.1.2.5
目标F#运行时:4.3.1.0
Target F# runtime: 4.3.1.0
目标框架:4.6
输出类型:类库
ManageAccount.dll
FSharp.Core:3.1.2.5
FSharp.Core: 3.1.2.5
目标F#运行时:3.3.1.0
Target F# runtime: 3.3.1.0
目标框架:.NET便携式子集(.Net Framework 4.5,ASP.Net Core 1.0,Windows 8)
Target Framework: .NET Portable Subset (.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设置为什么值?
If I do need an app config, what value should my bindingRedirect be set to?
推荐答案
尝试<bindingRedirect oldVersion="0.0.0.0-999.999.999.999" newVersion="3.3.1.0" />
.这就是大多数F#项目似乎为FSharp.Core所做的事情. (如果升级到较新的FSharp.Core,则为newVersion="4.3.1.0"
,甚至为newVersion="4.4.0.0"
.
Try <bindingRedirect oldVersion="0.0.0.0-999.999.999.999" newVersion="3.3.1.0" />
. That's what most F# projects seem to be doing for FSharp.Core. (Or newVersion="4.3.1.0"
, or even newVersion="4.4.0.0"
if you upgrade to a newer FSharp.Core).
这篇关于FSharp.Core:无法加载文件或程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!