0
I am creating an application with integration with Azure, when I try to instantiate the MobileServiceClient I have the following exception
Method 'System.Net.Http.HttpClientHandler.set_AutomaticDecompression' not found.
Here’s the definition of my class
public class AzureClient
{
    private IMobileServiceClient _client;
    private IMobileServiceSyncTable<Contact> _table;
    private const string serviceUri = "http://{app}.azurewebsites.net/";
    const string dbPath = "contactDb";
    public AzureClient()
    {
        _client = new MobileServiceClient(serviceUri);
        var store = new MobileServiceSQLiteStore(dbPath);
        store.DefineTable<Contact>();
        _client.SyncContext.InitializeAsync(store);
        _table = _client.GetSyncTable<Contact>();
    }
    public async Task<IEnumerable<Contact>> GetContacts()
    {
        var empty = new Contact[0];
        try
        {
            if (Plugin.Connectivity.CrossConnectivity.Current.IsConnected)
                await SyncAsync();
            return await _table.ToEnumerableAsync();
        }
        catch (Exception)
        {
            return empty;
        }
    }
    public async void AddContact(Contact contact)
    {
        await _table.InsertAsync(contact);
    }
    public async Task SyncAsync()
    {
        ReadOnlyCollection<MobileServiceTableOperationError> syncErrors = null;
        try
        {
            await _client.SyncContext.PushAsync();
            await _table.PullAsync("allContacts", _table.CreateQuery());
        }
        catch (MobileServicePushFailedException pushEx)
        {
            if (pushEx.PushResult != null)
                syncErrors = pushEx.PushResult.Errors;
        }
    }
    public async Task CleanData ()
    {
        await _table.PurgeAsync("allContacts", _table.CreateQuery(), new System.Threading.CancellationToken());
    }
}
The error happens when I try to run the project for Android. The complete project source code is in my github
I was going to do this marathon, but I’m in no condition at the moment. I’m wanting to learn Xamarin too.
– Maniero
It’s been a marathon anyway. But it is being very profitable the good that I will have carnival holidays and will give to research more about these problems.
– Pablo Tondolo de Vargas