Question

I created a WebAPI2 OData provider following Mike Wasson's tutorial found here. I then created a F# project to use the type providers to consume the service following the tutorial found here. The problem is that I am getting this exception when creating the Type Provider:

Error 1 The type provider 'Microsoft.FSharp.Data.TypeProviders.DesignTime.DataProviders' reported an error: error 7001: The element 'DataService' has an attribute 'DataServiceVersion' with an unrecognized version '3.0'.

Apparently, the most recent F# type providers do not support OData version 3. Is there a way that I can alter my OData service to return OData2 so that I can use the current F# type providers? Ideally, the F# type providers will support OData3 soon...

Was it helpful?

Solution

What are you using to host the OData service - WebAPI or WCF Data Services? If the former, there doesn't seem to be much support to gracefully fall back to V2. With WCF Data Services you can change the MaxVersion (the template DataService has the code in it) to V2 - I -believe- that this should do the trick.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top