简体   繁体   English

F#错误FS0039:未定义类型'XmlProvider'

[英]F# error FS0039: The type 'XmlProvider' is not defined

Looked at these for a couple solutions--but nothing works 看着这些有几个解决方案-但没有任何效果
The type 'XmlProvider' is not defined 未定义类型“ XmlProvider”
F# Data New type provider library F#Data新型提供程序库
F# Data: XML Type Provider F#数据:XML类型提供程序

open FSharp.Data
type XMLcountries = XmlProvider<"http://api.worldbank.org/country">
let sampleCountries = XMLcountries.GetSample()
let sampleCountries' = XMLcountries.Load("http://api.worldbank.org/country")

When using the interactive window, I get F# error FS0039: The type 'XmlProvider' is not defined. 使用交互式窗口时,出现F#错误FS0039:未定义类型'XmlProvider'。 Is there a better package/library to use XML provider(and JSON too). 是否有更好的包/库来使用XML提供程序(以及JSON)。

I have updated FSharp.Data to version 2.3.1 我已经更新了FSharp.Data到2.3.1版本

I added open FSharp.Data.TypeProviders to see if that would work. 我添加了打开的FSharp.Data.TypeProviders来查看是否可行。 Still same error. 还是一样的错误。

This is extremely frustrating. 这非常令人沮丧。

Are you sure you have looked at F# Data: XML Type Provider ? 您确定您已查看过F#Data:XML类型提供程序吗? Because at the very beginning it says: 因为一开始它说:

#r "../../../bin/FSharp.Data.dll"
#r "System.Xml.Linq.dll"
open FSharp.Data

So you have a couple of options, if you don't want to install FSlab, the second one is the easiest for you. 因此,您有两个选择,如果您不想安装FSlab,那么第二个选择对您来说最简单。 You obviously have to adjust the path to match your environment. 显然,您必须调整路径以匹配您的环境。

  1. Download and install FSLab , then reference FSLab with 下载并安装FSLab ,然后使用
    #load @"..\\..\\FSLAB\\packages\\FSLAB\\FsLab.fsx"
  2. Reference FSharp.Data.dll in your script: 在脚本中引用FSharp.Data.dll:
    #r @"..\\..\\FSLAB\\packages\\FSharp.Data\\lib\\net40\\FSharp.Data.dll"
  3. Add FSharp.Data to your References in Visual Studio and send the reference to FSI with a rigt-click (I do hope you have installed the Visual F# Power Tools ). 将FSharp.Data添加到Visual Studio中的“引用”中,然后单击一下即可将引用发送到FSI(我希望您已经安装了Visual F#Power Tools )。

Visual F#电动工具

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 F# 错误 FS0039:未定义值或构造函数“输入” - F# error FS0039: The value or constructor 'input' is not defined XmlProvider FS0039中的DomainTypes未定义 - DomainTypes in XmlProvider FS0039 not defined 为什么会出现F#错误FS0039:未定义名称空间或模块&#39;Http&#39; - Why am I getting F# error FS0039: The namespace or module 'Http' is not defined F#错误&#39;错误FS0039:未定义名称空间或模块&#39;MySql&#39;? - F# error 'error FS0039: The namespace or module 'MySql' is not defined'? F# CsvProvider can't find member in Row error FS0039 - F# CsvProvider cant find member in Row error FS0039 为什么在错误 FS0039 The type &#39;JsonProvider&#39; is not defined 时程序仍在运行? - Why is the program still running while Error FS0039 The type 'JsonProvider' is not defined? 错误FS0039:未定义字段,构造函数或成员&#39;X&#39; - error FS0039: The field, constructor or member 'X' is not defined 使用F#查询表达式时收到此消息:错误FS0039:未定义值或构造函数“查询” - I got this msg while using F# query expression : error FS0039: Undefined value or constructor “query” 来自F#XmlProvider的Typecheck错误FS3033 - Typecheck error FS3033 from F# XmlProvider 为什么我在 class 未定义的参数中收到错误提示 function - 错误 FS0039:值或构造函数“函数”未定义 - Why I get error saying function in argument for a class not defined - error FS0039: The value or constructor 'function' is not defined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM