McGarnagle
McGarnagle

Reputation: 102733

The namespace "TypeProviders" is not defined (open Microsoft.FSharp.Data.TypeProviders)

I'm walking through Visual Studio's F# tutorial project. When I uncomment the "OData" module (which is very simple, similar to this MSDN walkthrough), the first line here

open Microsoft.FSharp.Data.TypeProviders

type Northwind = ODataService<"http://services.odata.org/Northwind/Northwind.svc/">

// ...

indicates this compiler error:

The namespace "TypeProviders" is not defined

The error remains after adding a reference to "FSharp.Data.TypeProviders" and "System.Data.Services.Client".

What am I doing wrong here?

Upvotes: 3

Views: 1327

Answers (1)

Alexan
Alexan

Reputation: 8625

Okay, you need to create new project, then add FSharp.Data.TypeProviers nuget to this project and the following code should work:

open Microsoft.FSharp.Data.TypeProviders
type Northwind = ODataService<"http://services.odata.org/Northwind/Northwind.svc/">

Upvotes: 2

Related Questions