Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

ObjectDisposedException

$
0
0

I'm connecting my Xamarin forms project to a simple ASP.NET Web API but once I call PostAsync, ObjectDisposedException is thrown.

This exception doesn't occur when I use UWP but it does when I use Android.

        var client = new HttpClient();

        var model = new RegisterBindingModel
            {
                Email = email,
                Password = password,
                ConfirmPassword = confirmPassword
            };

            var json = JsonConvert.SerializeObject(model);

            HttpContent content = new StringContent(json);
            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");

            var response = await client.PostAsync("http://localhost:53490/api/Account/Register", content);

Any idea?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



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