문제

I'm trying to compile simple example:

open Microsoft.FSharp.Data

type Simple = JsonProvider<""" { "name":"John", "age":94 } """>
let simple = Simple.Parse(""" { "name":"Tomas", "age":4 } """)
simple.Age
simple.Name

I use MSVS 2010, .Net Framework 4.5.1 and FSharp.Data via nuget. But when I try to compile this example, I get error:

This token (<""", """>, (""") and """)) is reserved for future use.

How can I use F# Json Type Provider?

도움이 되었습니까?

해결책

Type providers are part of F# 3.0. Are you sure, you are using the F# 3.0 or F# 3.1 compiler? I thought Visual Studio 2010 came with F# 2.0.

I remember, that the """ strings were also added in F# 3.0

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top