5

I am trying to follow this Microsoft tutorial with no luck. https://learn.microsoft.com/en-us/aspnet/web-api/overview/odata-support-in-aspnet-web-api/odata-v4/create-an-odata-v4-endpoint . I created the web api project on visual studio 2017, and runned "Install-Package Microsoft.AspNet.Odata" on Package Manager Console, but I still get System.Web.OData namespace undefined ("The type or namespace Odata does not exist on 'System.Web'"). Any clue why is this happening?. The version of Odata installed is 7.0.1. Should I get another version?

2 Answers 2

6

See https://github.com/Microsoft/aspnet-api-versioning/issues/315:

With Microsoft.AspNet.OData v7.0, namespaces were changed from System.Web.OData to Microsoft.AspNet.OData.

Sign up to request clarification or add additional context in comments.

Comments

1

I found Microsoft.AspNet.OData 7.0.0 or above (even though 7.0.1 or 7.1.0) doesn't contain System.Web.Odata. You can install Microsoft.AspNet.OData 6.1.0 then System.Web.Odata will be auto-added under reference.

Install-Package Microsoft.AspNet.OData -Version 6.1.0

Comments

Your Answer

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.