none
System.Web.OData.Query goes undefined in VS2015 RRS feed

  • Question

  • Hello,

    I Googled and realized System.Web is deprecated. This is a inherited code and I need to fix it. Unfortunately I could not get the information as to what has replaced System.Web.OData. So AllowedQueryOptions, AllowedFunctions all go undefined. As you can see it is all supported in 2013: 

    https://msdn.microsoft.com/en-us/library/system.web.odata.query%28v=vs.118%29.aspx?f=255&MSPPError=-2147217396

    Please point me to the info where I can do the same thing using 2015

    thanks

    ananda

    Friday, April 6, 2018 1:57 AM

Answers

  • "I Googled and realized System.Web is deprecated"

    System.Web is not deprecated. Not sure where you heard that. You can continue to use System.Web.

    OData is still very much alive in .NET and can be used as well. On this page it discusses how to download the OData v4 NuGet package to add OData support to your app.

    Please post further questions related to OData and web API in the ASP.NET forums.


    Michael Taylor http://www.michaeltaylorp3.net

    Friday, April 6, 2018 2:15 PM
    Moderator
  • Please use
        using Microsoft.AspNet.OData.Builder;
        using Microsoft.AspNet.OData.Extensions;
    instead of
        using System.Web.OData.Builder;
        using System.Web.OData.Extensions;

    Friday, February 8, 2019 4:24 PM

All replies

  • I Googled and realized System.Web is deprecated. This is a inherited code and I need to fix it. Unfortunately I could not get the information as to what has replaced System.Web.OData. So AllowedQueryOptions, AllowedFunctions all go undefined. As you can see it is all supported in 2013: 

    So what .NET Framework version was the solution using in VS2013 that you  can't use the same .NET Framework in 2015, because you can select the .NET Framework to use if it's on the machine? And machines have multiple versions of the .NET Framework on them.

    Friday, April 6, 2018 11:46 AM
  • Thanks for the reply yes I am indeed confused. Let me reword my question so that I am clear as to what is my problem. I have inherited a old code. Right now I have a Windows 10 system with VS2015 and I have to make the program build. When I look at he .csproj file of the inherited code it says

    <Project ToolsVersion="12.0">

    When I list the VS related files under Program Files(x86) in my system it says

    03/06/2018  04:53 PM    <DIR>          Microsoft Visual Studio 11.0
    03/06/2018  04:57 PM    <DIR>          Microsoft Visual Studio 12.0
    03/06/2018  05:32 PM    <DIR>          Microsoft Visual Studio 14.0

    My .Net is 4.0 I checked via regedit

    I have enclosed as small sample program. The question is how do I make this program work? nuget does not have System.Web or System.Web.Odata. In the Add Reference I have selected System.Web and other related as shown but nothing worked. Also this inherited program has many modules and all of them do build this is the only one giving problem so the change has to be local for this .csproj only meaning I cant go back to VS2013 or change my setting system wide. Your help will be much appreciated. If this small Hello World builds that will make my day :-). Thanks

    using System;
    using System.Web.OData.Query;
    
    namespace ConsoleApplication1
    {
        class ProgramCS
        {
            static void Main(string[] args)
            {
                public AllowedQueryOptions myAllowedQueryOptions;
                Console.WriteLine("Hello World");
            }
        }
    }

    Friday, April 6, 2018 1:15 PM
  • "I Googled and realized System.Web is deprecated"

    System.Web is not deprecated. Not sure where you heard that. You can continue to use System.Web.

    OData is still very much alive in .NET and can be used as well. On this page it discusses how to download the OData v4 NuGet package to add OData support to your app.

    Please post further questions related to OData and web API in the ASP.NET forums.


    Michael Taylor http://www.michaeltaylorp3.net

    Friday, April 6, 2018 2:15 PM
    Moderator
  • Hi Michael,

    I just tried
    Install-Package Microsoft.AspNet.Odata and it worked System.Web.OData.Qurey got resolved. Thanks a lot the URL gave me the idea. Now I have issue with 

    using OData.Core; going undefined. How ever let me Google and do my due diligence before asking for help.

    Thanks again. 

    regards

    ananda

    Friday, April 6, 2018 4:12 PM
  • Please use
        using Microsoft.AspNet.OData.Builder;
        using Microsoft.AspNet.OData.Extensions;
    instead of
        using System.Web.OData.Builder;
        using System.Web.OData.Extensions;

    Friday, February 8, 2019 4:24 PM