lundi 13 février 2017

Is Newtonsoft.JSON supported for .net Framework 4.6 in Xamarin.Android?

Vote count: 0

I'm consuming WCF based web services for an android app. Previously the web application (for which webservices have been written) was using .NET framework 3.5, recently it was migrated to .net framework 4.6. The below pieces of code are throwing the exception : "Error: NameResolutionFailure at System.Net.HttpWebRequest.EndGetResponse"

url = http://ift.tt/2lHu8Ad

private async Task FetchErrAsync(string url) {

        HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(new Uri(url));
        request.ContentType = "application/json";
        request.Method = "GET";


        using (WebResponse response = await request.GetResponseAsync())
        {


            using (Stream stream = response.GetResponseStream())
            {

                JsonValue jsonDoc = await Task.Run(() => JsonObject.Load(stream));

                                    return jsonDoc;
            }
        }
        }

The webservices are up and running. Json format data is being displayed in a normal web browser, however from the android app, we are getting the above exception. Note: This code was working fine when the web application was running on .NET framework 3.5

asked 19 secs ago

Let's block ads! (Why?)



Is Newtonsoft.JSON supported for .net Framework 4.6 in Xamarin.Android?

Aucun commentaire:

Enregistrer un commentaire