Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot open Fsharp.Data in Visual F#

I'm learning F# by trying some example code in tryfsharp.org in Visual F#. I installed the Fsharp.Data using nuget package console:

Install-Package FSharp.Data 

'FSharp.Data 2.1.1' already installed.
Adding 'FSharp.Data 2.1.1' to TryFsharp.
Successfully added 'FSharp.Data 2.1.1' to TryFsharp.

When I try to reference it:

#r "Fsharp.Data.dll"
Program.fs(10,1): error FS0084: Assembly reference 'Fsharp.Data.dll' was not found or is invalid

open Fsharp.Data
Program.fs(11,6): error FS0039: The namespace or module 'Fsharp' is not defined

Here is my project structure:

|-- ArchitectureExplorer
|-- Backup Files
|   |-- ConsoleApplication1
|   |-- ConsoleApplication2
|   |-- ConsoleApplication3
|   |-- ConsoleApplication4
|   |-- FSharpKoans
|   |-- FsharpInFinance
|   |-- TryFsharp
|   |-- Tutorial1
|   `-- Tutorial2
|-- Blend
|   |-- ItemTemplates
|   `-- ProjectTemplates
|-- Code Snippets
|   |-- JavaScript
|   |-- SQL_SSDT
|   |-- Visual Basic
|   |-- Visual C#
|   |-- Visual C++
|   |-- Visual Web Developer
|   |-- XAML
|   `-- XML
|-- Projects
|   |-- ConsoleApplication1
|   |-- ConsoleApplication2
|   |-- ConsoleApplication3
|   |-- ConsoleApplication4
|   |-- FsharpInFinance
|   |-- TryFsharp
|   |-- Tutorial1
|   |-- Tutorial2
|   `-- WpfApplication1
|-- Settings
|   |-- CurrentSettings-2015-01-17.vssettings
|   |-- CurrentSettings.vssettings
|   |-- FontsAndColorsBackup_a4d6a176-b948-4b29-8c66-53c97a1ed7d0.vssettings
|   |-- Old.CurrentSettings.vssettings
|   `-- Windows Azure Subscriptions.xml
|-- StartPages
|-- Templates
|   |-- ItemTemplates
|   `-- ProjectTemplates
|-- Visualizers
|   |-- attribcache90.bin
|   |-- autoexp.cs
|   |-- autoexp.dll
|   |-- autoexpce.cs
|   `-- autoexpce.dll
|-- nuget.config
`-- packages
    |-- Deedle.1.0.6
    |-- FSharp.Data.2.0.14
    |-- FSharp.Data.2.1.1
    |-- FsCheck.1.0.4
    `-- repositories.config

Is there any extra step I need to do before using it?

like image 269
Nick Avatar asked May 06 '26 10:05

Nick


1 Answers

As you can infer from you error message, you need to specify correct location of Fsharp.Data.dll with your #r directive. It could be relative to your current directory or absolute.

Alternatively(more easy IMO), you can install F# Power Tools and use it's Send To Interactive feature - just right-click on assembly in References and select this option.

like image 131
ntr Avatar answered May 09 '26 13:05

ntr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!