【发布时间】:2017-02-03 10:25:22
【问题描述】:
我正在测试我的应用程序,它使用的是 RESTful 服务。到现在为止还挺好。我已将我的服务部署到 aszure 并且一切正常。现在的问题是,我的 UWP-Application 拒绝连接到该服务。
我正在使用 HTTPClient
Client = new HttpClient();
Client.MaxResponseContentBufferSize = 256000;
Client.Timeout = TimeSpan.FromSeconds(5);
var response = Client.GetAsync(uri).Result;
Client.GetAsync 向我抛出异常。
我已在 Package.appxmanifest(Internet 和专用网络)中设置功能
例外:
Count = error CS0103: The name 'InnerExceptionCount' does not exist in the current context
内部异常:
{"Der Text zu diesem Fehlercode wurde nicht gefunden.\r\n\r\nDie Serververbindung konnte nicht hergestellt werden.\r\n"}
InnecException 是德语,意思是“找不到此错误代码的文本。无法连接到服务器。”
在使用 localhost 以外的其他服务时遇到此异常真的很奇怪,如果我使用 localhost,一切正常。你有什么建议吗?
屏幕截图包.appxmanifest (UWP):
【问题讨论】:
-
我也有同样的问题,你找到解决办法了吗? (gleiche Fehlermeldung ;))
标签: c# rest uwp xamarin.forms