Search code examples
csvf#type-providers

F# Script File Can't Reference FSharp.Data


I am new to F#. I'm trying to use the CSV Type Provider in an F# Script File.

I created a new project in Visual Studio 2015 and added the FSharp.Data nuget package.

I created a script file with the following contents:

#r "../packages/FSharp.Data.2.3.2/lib/portable-net45+netcore45/FSharp.Data.dll"

open FSharp.Data

type Logs = CsvProvider<"logs.csv">

However, I get red squiggly lines under the open FSharp.Data line. The intelisense says "The type referenced through System.Globalization.CultureInfo is defined in an assembly that is not referenced.

Also there is a red squiggly line under CsvProvider that says "The type 'CsvProvider' is not defined".

I am using this tutorial as a reference but I don't understand why it is not working: http://fsharp.github.io/FSharp.Data/library/CsvProvider.html


Solution

  • Ok, thanks to some help from a friend I found the issue. I added the following line and it fixed the issue.

    #r "System.Globalization"