Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
F# FSharp.Core:无法加载文件或程序集_F# - Fatal编程技术网

F# FSharp.Core:无法加载文件或程序集

F# FSharp.Core:无法加载文件或程序集,f#,F#,我在尝试运行测试时出现以下错误: <?xml version="1.0" encoding="utf-8"?> <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="FSharp.Core"

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

<?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>
{System.IO.FileLoadException:无法加载文件或程序集 'FSharp.Core,版本=3.3.1.0,区域性=中性, PublicKeyToken=b03f5f7f11d50a3a'或其依赖项之一 定位程序集的清单定义与程序集不匹配 参考。(HRESULT中的异常:0x8013100)文件名: 'FSharp.Core,版本=3.3.1.0,区域性=中性, PublicKeyToken=b03f5f7f11d50a3a'at Register.RegisterResponse.\uu调试显示()

测试.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框架4.5,ASP.NET核心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应该设置为什么值?

试试
。这就是大多数F#项目为FSharp.Core所做的。(或者
newVersion=“4.3.1.0”
,甚至
newVersion=“4.4.0.0”
如果升级到较新的FSharp.Core)。

您应该使用最新版本(本例中为
4.3.1.0
)在
bindingRedirect/newVersion
中,否则,您可能会从依赖较新版本的
Tests.dll
程序集中的代码中获得错误

或者,您可以更新其中一个程序集中的引用(降级
Tests.dll
或升级
ManageAccount.dll
),以便它们使用相同的版本