问题描述
在 Visual Studio 2013 中打开了一个空的 F# 项目。
open System
[<EntryPoint>]
let main argv =
printfn "%A" argv
System.Console.ReadKey() |> ignore
0
我一安装 FSharp.Data 包,项目就会停止编译,并出现以下错误:
The design-time type 'System.String' utilized by a type provider was not found in the target reference assembly set '[tgt assembly FSharp.Data,Version=3.3.3.0,Culture=neutral]'.
You may be referencing a profile which contains fewer types than those needed by the type provider you are using.
parse error FS3033
不确定它是否相关但 NuGet 也安装了 FSharp.Core 4.0.0.1,即使 MSVS 2013 带有 FSharp.Core 4.3.0.0 和 4.3.1.0
MSVS 升级不是我的选择。
那么问题是如何在面向 .NET 4.5 的 MSVS 2013 项目中使用 F# 类型提供程序?
解决方法
这不可能。较新版本的类型提供程序不会在较旧的 Visual Studio 版本中加载。如果您无法升级 Visual Studio 版本,请尝试使用旧版本的类型提供程序,例如 2.0.0 版。