在Windows Phone 8.1模拟器上发送Http请求以休息api时出现ErrOR 0x80072efd [英] ErrOR 0x80072efd when sending an Http request to rest api on Windows Phone 8.1 Emulator

查看:63
本文介绍了在Windows Phone 8.1模拟器上发送Http请求以休息api时出现ErrOR 0x80072efd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用Windows Phone 8.1应用,这是我的第一个应用。我想通过模拟器Windows Phone 8.1将http请求发送到远程服务器。因此,我使用了该代码:

I'm currently working on a Windows Phone 8.1 app, my first one actually. I would like to send through my emulator windows phone 8.1, a http request to a remote server. So I've used that code:

 try
 {
   mailToCheck.MailProfil = TxtBox_mail.Text.ToString();
   string js = JsonConvert.SerializeObject(mailToCheck);
   HttpClient httpClient = new HttpClient();
   httpClient.DefaultRequestHeaders.Add("Accept",       "Application/JSON");

   HttpRequestMessage data = new HttpRequestMessage(HttpMethod.Post, new Uri("url");
   data.Content = new HttpStringContent((js));
   HttpResponseMessage response = await httpClient.SendRequestAsync(data).AsTask();
   string statusCode = response.StatusCode.ToString();
  }catch (Exception ex)
  {

  }

我总是收到该错误:0x80072efd。
我听说过表示没有互联网连接,但是我可以在模拟器Web浏览器的网站上进行导航。已检查网络功能。是否有人已经遇到该问题?也许是Hyper-V阻止了?
预先感谢

and I'm always getting that error : 0x80072efd. I've heard of it means that there is no internet connexion but I'm able to navigate on website on the emulator web browser. The Networking capability is checked. Does somebody already faced that issue ? Maybe the Hyper-V blocking ? Thanks in advance

推荐答案

在尝试了网络上提出的所有解决方案后,我不知道如何解决该问题。根本不起作用:
-清理Hyper-V上的虚拟机
-禁用/允许Hyper-V
-使用Visual Studio修复SDK维修工具。
-重新安装Visual Studio 2013更新2。
4英寸仿真器8.1 WVGA-512 MB 仍然无法正常工作。不知何故,我试图在 4英寸Emulator 8.1 WVGA 上启动我的项目,它运行起来很神奇。我为解决该问题而进行的尝试花了很多时间,但没有成功。因此,我的建议是使用以下仿真器:仿真器8.1 WVGA 4英寸
这些模拟器之间的区别在于应用程序允许的内存,如果您使用 4英寸Emulator 8.1 WVGA ,请注意低性能设备的性能管理,例如Lumia 520。

After trying all the solutions proposed all over the web, I couldn't figure out how to solve that problem. All the following didn't work at all: - Cleaning of the virtual machines on Hyper-V - Disable/Able Hyper-V - Repair the SDK with visual studio repair tool. - Re-install Visual Studio 2013 update 2. Still not working the Emulator 8.1 WVGA 4 inch - 512 MB. Somehow, I've tried to launch my project on the Emulator 8.1 WVGA 4 inch and it works magically. My trials to solve that problem took a lot of time and came to nothing. So my advise is to use the following emulator: Emulator 8.1 WVGA 4 inch. The difference between these emulators is about the memory allowed for the app, if you use Emulator 8.1 WVGA 4 inch just be careful about performance management for low performance devices as Lumia 520 for example.

这篇关于在Windows Phone 8.1模拟器上发送Http请求以休息api时出现ErrOR 0x80072efd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆