Search code examples
f#xamarin-studiosuave

Error message in Xamarin Studio: Multiple references to FSharp.Core.dll are not permitted


When I set up a new F# project in Xamarin Studio with a reference to Suave I get an error.

Here are the steps to reproduce the error message:

  1. Create a new solution in Xamarin Studio 6. Type: Console Project in F#
  2. Add the Suave nuget package: Suave 1.1.2
  3. Open Program.fs and add this line on the top of the file: 'open Suave'

After this the word 'open' is decorated with red squiggles and when I move the mouse pointer over it a little pop up appears with this message:

Error: Multiple references to 'FSharp.Core.dll' are not permitted

Why does this error messages come up and how do I remove it?

What I have noticed is that the installation of the Suave nuget package had also caused the installation of the FSharp.Core nuget pakage. Here is the resulting packages.conf file:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="FSharp.Core" version="3.1.2.5" targetFramework="net45" />
  <package id="Suave" version="1.1.2" targetFramework="net45" />
</packages>

Solution

  • This happens because the Xamarin's F# project template by default references the local copy of FSharp.Core.

    Removing the (duplicated) reference should fix the issue.