Question

How do I run FParsec in VS2013 Professional Edition?

I tryed to use the following nuget packages:

and I tried to compile the source-code of https://bitbucket.org/fparsec/main on my own and use the generated dlls: FParsec.dll and FParsecCS.dll.

But in either way I always get the following exception running the tutorial code:

System.MissingMethodException
Method not found: 
  Microsoft.FSharp.Core.FSharpFunc`2<FParsec.CharStream`1<!!0>,FParsec.Reply`1<Double>> FParsec.CharParsers.pfloat()"

Can anyone provide a step-by-step solution who to get FParsec running on VS2013?

This is the code I try to run:

open FParsec

[<EntryPoint>]
let main args =
  let str s = pstring s // This line works
  let floatBetweenBrackets = str "[" >>. pfloat .>> str "]" // This line breaks
  Console.ReadKey() |> ignore
  0
Was it helpful?

Solution

Try to add App.config to your project with following content:

<?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-4.3.1.0" newVersion="4.3.1.0" />
      </dependentAssembly>
  </runtime>
</configuration>

Check your version of FSharp.Core and patch this snippet if necessary.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top