本文介绍了脚本无法识别FSharp.Data的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

F#初学者的一些知识.我试图通过首先在脚本(fsx)文件中输入XmlTypeProvider代码来在交互式窗口中测试一些代码.脚本文件无法识别以下内容

Somewhat of a F# beginner. I'm trying to test out some of my XmlTypeProvider code in the interactive window by first entering it in a script (fsx) file. The script file won't recognize the following

open FSharp.Data  // gives "The namespace or module 'FSharp' is not defined"

所有内容都已添加到引用中,并且.fs文件似乎在查找XmlTypeProvider引用方面没有任何问题,但是由于某种原因,同一项目中的脚本却没有.我什至得到了在.fs文件中工作的代码.

Everything has been added to reference, and .fs files seem to not have any problems finding the XmlTypeProvider reference but for some reason, a script in the same project does not. I even got the code to work in a .fs file.

我添加了带有nuget的FSharp.Data,一切似乎都正确添加了.我在这里想念什么?

I added FSharp.Data with nuget and everything seem to add correctly. What am I missing here?

推荐答案

在脚本中将引用添加到包含FSharp.Data.dll的nuget软件包文件夹中.该文件夹还包含设计器dll(FSharp.Data.DesignTime.dll)

Add a reference in the script to the nuget packages folder that contains FSharp.Data.dll. That folder also contains the designer dll (FSharp.Data.DesignTime.dll)

#r @"<your nuget packages folder>\FSharp.Data.2.1.0\lib\net40\FSharp.Data.dll"

这篇关于脚本无法识别FSharp.Data的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-07 15:07