在Xamarin.Forms项目中,我在Windows 8.1和UWP上收到错误:

Could not load file or assembly 'FSharp.Core, Version=3.259.3.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

整个解决方案中使用的F#的实际版本是3.7.4.0:

<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
<TargetProfile>netcore</TargetProfile>
<TargetFSharpCoreVersion>3.7.4.0</TargetFSharpCoreVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>

有一个F#PCL项目和C#平台特定的项目 . 只有在PCL中使用Nuget的F#库时才会发生错误 . 这些包往往使用:

<TargetFSharpCoreVersion>3.259.3.1</TargetFSharpCoreVersion>

我尝试了以下内容,但它们不会更改错误:

  • 将带有绑定重定向的app.config文件放到F#项目和/或构建目录中的3.7.4.0

  • 将FSharp.Core Nuget软件包安装到所有项目中

非常感谢任何帮助 .

Edit: 在原始问题中,配置文件(111)与预期的TargetFSharpCoreVersion(3.7.4.0)之间存在不兼容性,这导致了其他问题 .