Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

System.Net.Http.UriExtensions wrong signature for .NET version

$
0
0

I just noticed that the .NET 4.5 variant for the nuget package Mirosoft.AspNet.WebApi.Client 5.2.3 doesn't match the signature of the PCL variant.
And it's causing a missing method exception at runtime when I call the Uri.ParseQueryString() method from a .NET 4.5 project...


This is the PCL variant (which returns an HttpValueCollection)

namespace System.Net.Http
{
    public static class UriExtensions
    {
        public static HttpValueCollection ParseQueryString(this Uri address);
        public static bool TryReadQueryAs(this Uri address, Type type, out object value);
        public static bool TryReadQueryAs<T>(this Uri address, out T value);
        public static bool TryReadQueryAsJson(this Uri address, out JObject value);
    }
}

And this is the .NET variant: (which returns a NameValueCollection instead)

namespace System.Net.Http
{
    public static class UriExtensions
    {
        public static NameValueCollection ParseQueryString(this Uri address);
        public static bool TryReadQueryAs(this Uri address, Type type, out object value);
        public static bool TryReadQueryAs<T>(this Uri address, out T value);
        public static bool TryReadQueryAsJson(this Uri address, out JObject value);
    }
}

Is there any known workaround for this issue?


Viewing all articles
Browse latest Browse all 4850

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>