MissingMethodException when using FParsec
Options
Adding the nuget package for FParsec (v 1.0.2) to a new 'F# Program' query and running the tutorial sample code results in a System.MissingmethodException with message:
Method not found: 'Microsoft.FSharp.Core.FSharpFunc`2,FParsec.Reply`1> FParsec.CharParsers.pfloat()'.
Minimal code to reproduce is:
open FParsec
run pfloat "1.0"
I'm not exactly sure how to diagnose the problem, or where to go from here.
Any assistance anyone could provide would be greatly appreciated!
Method not found: 'Microsoft.FSharp.Core.FSharpFunc`2,FParsec.Reply`1> FParsec.CharParsers.pfloat()'.
Minimal code to reproduce is:
open FParsec
run pfloat "1.0"
I'm not exactly sure how to diagnose the problem, or where to go from here.
Any assistance anyone could provide would be greatly appreciated!
Comments
-
I'm also having this problem. Running the same code from a VS2015 project works fine, but no matter what I do I cannot get the first example from the link below to run in LINQPad without throwing a System.MissingmethodException:
http://www.quanttec.com/fparsec/tutorial.html
A bit of googling turned up these links:
http://stackoverflow.com/questions/23608713/howto-run-fparsec-in-vs2013
https://github.com/Microsoft/visualfsharp/issues/789#issuecomment-164248668
So it looks like it might be an issue with mismatched FSharp.Core versions? The latest version of FSharp.Core (4.4.0.0) is being referenced within my query (confirmed by running Assembly.GetExecutingAssembly().GetReferencedAssemblies().Dump(); as the first command), but it looks like FParsec is built against FSharp.Core 4.3.0.0...
I tried putting a binding redirect for FSharp.Core into LINQPad.exe.config, but LINQPad immediately crashed on opening after that, so I removed it again. -
Update: I just downloaded the FParsec source and built it against FSharp.Core 4.4.0.0, referenced the resulting DLLs directly from within LINQPad, and the query now runs successfully. So it is definitely something to do with mismatched F# versions!