c# - 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();
}
解决方案
作为一种解决方法,在客户端构造函数上添加一个 HttpHandler 使其工作!
client = new MobileServiceClient(AzureUrl, new HttpClientHandler());
Brendan Zagaeski 的回答最初在 这里找到。
推荐阅读
- selenium - Selenium IDE 能否在 Windows 保存对话框中单击保存?
- python-docx - Python PPTX Datalabel 填充颜色
- python - AttributeError:“NoneType”对象没有属性“_global_run_stack”
- api - Xamarin Forms Refit 响应是错误的
- react-native - 开玩笑单元测试:“SyntaxError:不能在模块外使用导入语句”PushNotificationsIOS
- zxing - 在 Squeak 中实现了 ZXing 的 Reed Solomon 纠错。很慢
- java - 根据活动(Android)更改自定义适配器上的布局文件
- r - 在 R 中,将相同 ID 的多个逻辑行折叠成 1 行
- sql - 如何编写给出两个表差异的程序?
- node.js - 打字稿:任何人都有一种优雅的方式来接收具有已知时区的日期字符串并将其转换为 UTC