Simple F# TypeProvider code cannot run in LINQPad

edited December 2018
Say I have code like this and with nuget package FSharp.Data installed:
open FSharp.Data

[<Literal>]
let path = @"https://www.linqpad.net"
type QueryHtml = HtmlProvider<path>
let html = QueryHtml.Load(path)
This code run perfectly fine with Visual Studio, but when I run it in latest LINQPad(5.37.00), it will throws a MissingMethodException:
MissingMethodException:
Failed to find method:“Microsoft.FSharp.Control.FSharpAsync`1<System.IO.TextReader> FSharp.Data.Runtime.IO.asyncReadTextAtRuntime(Boolean, System.String, System.String, System.String, System.String, System.String)”。
I switched both "Always use built-in F# compiler" On/Off, and switched both FSharp.Data version 3.0/2.x, both throw this exception. Is there any reason or any solution for this?

Comments

  • Is there any explaination or solution?
  • Hi, was getting the same error, and adding FSharp.Core 4.6 using linqpad nuget fixed it, if you check your visual studio project there is a very good chance that the project also has FSharp.Core
  • Thanks, install FSharp.Core nuget package fixed it.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!