首页 > 解决方案 > Azure MobileServiceClient stopped working after updating Visual Studio to 16.3.7

问题描述

I have a Xamarin Forms app for Android that uses a MobileAppService to retrieve data from an Azure SQL Database with EntityFramework, this worked well until I updated Visual Studio to 16.3.7, now the MobileAppService doesn't retrieve anything, I don't get exceptions or anything it just returns null.

This is the query I'm trying to run, I've tried with others and it's the same, it just returns null.

Also, my app service is up and running I tried querying directly and it works!

The url to my app service: https://avalis.azurewebsites.net

async Task<Usuario> IAzureAppService.GetUsuarioByUsernameAsync(string username){
        Initialize();
        return (await usuariosTable.Where(r => r.NombreUsuario == username).ToEnumerableAsync()).FirstOrDefault();
}

Here is the about of my Visual Studio

标签: c#entity-frameworkxamarinazure-sql-databaseazure-web-app-service

解决方案


作为一种解决方法,在客户端构造函数上添加一个 HttpHandler 使其工作!

client = new MobileServiceClient(AzureUrl, new HttpClientHandler());

Brendan Zagaeski 的回答最初在 这里找到。


推荐阅读