Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use FSharp.Data with VS 2015?

I'm trying to using FSharp.Data in a script file on a FSharp project, and the error that I'm receiving is:

Warning '..\packages\FSharp.Data.2.2.5\lib\net40\FSharp.Data.dll' is not a valid assembly name.

FSharp.Data from https://www.nuget.org/packages/FSharp.Data/

It's the same problem if I try with a F# project for .NET 4.0, .NET 4.5 or .NET 4.6.

EDIT: It works fine with '..\packages\FSharp.Data.2.2.5\lib\portable-net40+sl5+wp8+win8\FSharp.Data.dll' but in this portable version only web locations are supported.

like image 902
J. Lennon Avatar asked Sep 10 '15 22:09

J. Lennon


People also ask

What is FSharp data?

The FSharp.Data package contains type providers and utilities to access. common data formats (CSV, HTML, JSON and XML in your F# applications and scripts. It also. contains helpers for parsing CSV, HTML and JSON files and for sending HTTP requests.

What is F# in Visual Studio?

F# is a fully supported language in Visual Studio and JetBrains Rider. Plug-ins supporting F# exist for many widely used editors including Visual Studio Code, Vim, and Emacs. F# is a member of the ML language family and originated as a . NET Framework implementation of a core of the programming language OCaml.


1 Answers

I think the problem is string escaping. In the following:

#r "..\packages\FSharp.Data.2.2.5\lib\net40\FSharp.Data.dll"

The \n is interpreted as a new-line character and so it is invalid. But in the following:

#r "..\packages\FSharp.Data.2.2.5\lib\portable-net40+sl5+wp8+win8\FSharp.Data.dll"

.. there are no special escape sequences in the string. Both of the following should work:

#r @"..\packages\FSharp.Data.2.2.5\lib\net40\FSharp.Data.dll"
#r "..\\packages\\FSharp.Data.2.2.5\\lib\\net40\\FSharp.Data.dll"
like image 88
Tomas Petricek Avatar answered Oct 04 '22 23:10

Tomas Petricek