"Consider app.config remapping of assembly ..." warning in F#

30,002

Solution 1

Below is I think a sample app.config that does what is suggested. However, what is in your project, and what FSharp.Core reference is there? Are you targeting .Net 4.5 or 4.0 or what? Does this project reference some older F# library? This typically is because two projects reference different versions of FSharp.Core.dll, e.g. check the <Reference> nodes in the .fsproj files.

<?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>

Solution 2

same error related to Json.Net

In project file I had

<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>

and

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

Deleting the old one solved the problem.

Share:
30,002

Related videos on Youtube

Oldrich Svec
Author by

Oldrich Svec

Updated on April 25, 2020

Comments

  • Oldrich Svec
    Oldrich Svec about 4 years

    After I installed VS11, I started to get the following error:

    Consider app.config remapping of assembly "FSharp.Core, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "2.0.0.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v2.0\FSharp.Core.dll] to Version "4.0.0.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v4.0\FSharp.Core.dll] to solve conflict and get rid of warning. C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1490,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly.

    What exactly should I do? I have no idea how to do such a remapping.

  • Oldrich Svec
    Oldrich Svec over 12 years
    There is no version of FSharp.Core mentioned in the fsproj. Here is a link (dl.dropbox.com/u/4571/send.zip) to the fsproj files. I was looking in them but I did not see anything strange. I am targeting .NET 4.0 CL and I am not aware of referencing anything old, but it might be :)
  • Oldrich Svec
    Oldrich Svec over 12 years
    Do you have any further suggestions?
  • Prakash
    Prakash over 12 years
    Yes. Create a new F# project with VS11, and inspect its .fsproj file. Now change your existing projects by removing the <Import> lines from targets files and replacing them with those seen in the newly created VS11 project. Also, the newly created project will have explicit <Reference>s to mscorlib and FSharp.Core. Add those to your projects if they are not there (with the desired version/targeting if needed). I think then things will work.
  • Oldrich Svec
    Oldrich Svec over 12 years
    If I do that, will the solution work on computers without VS11? I cooperate on that project with one workmate who does not have VS11 installed on his machine.
  • Oldrich Svec
    Oldrich Svec over 12 years
    After many trials and errors, I have found that the problem occurs due to Fsharp.PowerPack + compilation into exe. When I create a new solution both in VS10 and VS11 and insert a reference to the powerpack, I get the warning. Is there anything I can do about the powerpack?
  • Prakash
    Prakash over 12 years
    You either need to recompile the PowerPack from source, or use the binding redirect; the PowerPack binary is hardwired to the 2.0.0.0 version of FSCore right now.
  • Robert Jeppesen
    Robert Jeppesen almost 12 years
    A suggestion for PowerPack - The one you download from Nuget comes in many flavors, including 4.0.
  • mcliedtk
    mcliedtk over 11 years
    This tool helped me diagnose a similar issue: mikehadlow.blogspot.com/2011/02/…