none
the method 'Any' is not supported when MaxProtocolVersion is less than '3.0' RRS feed

  • Question

  • I have recently upgraded my project from .NET Framework 4.5.1 to 4.7.2 and added a WCF service reference in the project.

    When I add service reference to .NET Framework 4.5.1 project the auto-generated code in reference.cs file has below constructor method

    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")]
            public abc(global::System.Uri serviceRoot) : 
                    base(serviceRoot, global::System.Data.Services.Common.DataServiceProtocolVersion.V3)

    But when I added service reference to .NET Framework 4.7.2 project the auto-generated code in reference.cs file has below constructor method

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")]
            public abc(global::System.Uri serviceRoot) : 
                    base(serviceRoot)

    The version parameter doesn't exist in inherited base class of .NET Framework 4.7.2 project. This is causing the below error during run time

    the method 'Any' is not supported when MaxProtocolVersion is less than '3.0'

    When I add the parameter manually and run the project it works completely fine. But I can't add the parameter manually as it is auto-generated file and gets updated once i update the service

    I have looked at WCF service .svc file and the InitializeService(DataServiceConfiguration config) method has below line of code.

    config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;

    Thanks in advance


    • Edited by sasidharc Thursday, February 28, 2019 3:20 PM
    Thursday, February 28, 2019 1:51 PM