“在F#中考虑装配的app.config重新映射...”警告

问题描述 投票:22回答:3

安装VS11后,我开始收到以下错误:

考虑从版本“2.0.0.0”[C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ FSharp \ 2.0 \ Runtime \ v2中重新装配程序集“FSharp.Core,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a”的app.config。 0 \ FSharp.Core.dll]到版本“4.0.0.0”[C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ FSharp \ 2.0 \ Runtime \ v4.0 \ FSharp.Core.dll]来解决冲突和摆脱警告。 C:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets(1490,5):警告MSB3247:发现同一依赖程序集的不同版本之间存在冲突。

我该怎么办?我不知道如何做这样的重新映射。

f# compiler-warnings
3个回答
19
投票

下面是我认为一个示例app.config执行建议。但是,您的项目中有什么,以及FSharp.Core引用的内容是什么?您的目标是.Net 4.5或4.0还是什么?这个项目是否引用了一些较旧的F#库?这通常是因为两个项目引用了不同版本的FSharp.Core.dll,例如检查.fsproj文件中的<Reference>节点。

<?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="0.0.0.0-2.9.9.9" newVersion="4.3.0.0"/>  -->
          <bindingRedirect oldVersion="2.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

3
投票

与Json.Net相关的错误

在我的项目文件中

<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
   <SpecificVersion>False</SpecificVersion>
   <HintPath>..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>

<ItemGroup>
   <Reference Include="Newtonsoft.Json">
      <HintPath>..\packages\Newtonsoft.Json.5.0.6\lib\net45\Newtonsoft.Json.dll</HintPath>
   </Reference>
</ItemGroup>

删除旧的解决了这个问题。


0
投票

如果你已经完成升级,那么应该没有这样的问题......除非你使用的是某些第三方库,否则它会使用旧的FSharp.Core本身。就我而言,FSharpPowerPack是这样做的。

因此,您必须首先更新该库以消除此消息。

© www.soinside.com 2019 - 2024. All rights reserved.