Estoy tratando de conectar una aplicacion de Xamarin Forms con Microsoft Azure y al momento de compilar me despliega el sig error:
Method 'System.Net.Http.HttpClientHandler.set_AutomaticDecompression' not found.
Azure Client:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.WindowsAzure.MobileServices;
namespace Catcher
{
public class AzureClient
{
private IMobileServiceClient client;
private IMobileServiceTable<Registro> table;
public AzureClient()
{
client = new MobileServiceClient("http://catcher.azurewebsites.net");
table = client.GetTable<Registro>();
}
public Task<IEnumerable<Registro>> GetUsers() {
return table.ToEnumerableAsync();
}
}
}
Registro.cs
using System;
using Microsoft.WindowsAzure.MobileServices;
using Newtonsoft.Json;
namespace Catcher
{
[DataTable("users")]
public class Registro
{
[JsonProperty("user")]
public string user { get; set; }
[JsonProperty("password")]
public string password { get; set; }
}
}
registro_page.xaml.cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Xamarin.Forms;
namespace Catcher
{
public partial class Registro_Page : ContentPage
{
private AzureClient client;
public ObservableCollection<Registro> users { get; set; }
public Command RefreshCommand { get; set; }
public Registro_Page()
{
users = new ObservableCollection<Registro>();
RefreshCommand = new Command(() => Load());
client = new AzureClient();
InitializeComponent();
}
public async void Load() {
IsBusy = true;
users.Clear();
var result = await client.GetUsers();
foreach (var user in result) {
users.Add(user);
}
IsBusy = false;
}
}
}
app.xaml.cs
using Xamarin.Forms;
namespace Catcher
{
public partial class App : Application
{
private Registro_Page registroPage;
public App()
{
InitializeComponent();
registroPage = new Registro_Page();
MainPage = new Registro_Page();
}
protected override void OnStart()
{
// Handle when your app starts
registroPage.Load();
}
protected override void OnSleep()
{
// Handle when your app sleeps
}
protected override void OnResume()
{
// Handle when your app resumes
}
}
}