3

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?

asked Jun 5, 2014 at 17:50
9
  • @abatishchev no compiler warnings, apparently... there is another error that does not seem related to resolving the library reference: The type provider 'Microsoft.FSharp.Data.TypeProviders.DesignTime.DataProviders' reported an error: Error reading schema. The remote server returned an error: (400) Bad Request. Commented Jun 5, 2014 at 17:58
  • try open FSharp.Data instead Microsoft.FSharp.Data.TypeProviders Commented Jun 5, 2014 at 18:51
  • @Alex "FSharp..." is the name of the assembly, the namespace is "Microsoft.FSharp..." msdn.microsoft.com/en-us/library/hh362324.aspx Commented Jun 5, 2014 at 18:55
  • okay, maybe it's because I used Freebase Provider from this library: fsharp.github.io/FSharp.Data, but it doesn't include OData. Commented Jun 5, 2014 at 19:05
  • install FSharp.Data.TypeProviers nuget. Probably you're missing some reference, maybe policy.2.3.FSharp.Core Commented Jun 5, 2014 at 22:05

1 Answer 1

2

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/">
answered Jun 5, 2014 at 22:54

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.