UWP 启用本地网络环回 [英] UWP Enable local network loopback

查看:48
本文介绍了UWP 启用本地网络环回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个 UWP 应用程序,在生成并安装了 .appxbundle 之后,每次启动该应用程序时,我都会收到一个 net_http_client_execution_error.在 Visual Studio 2015 中启动时,该应用程序启动并运行良好.因此,如果我调试该应用程序,我就没有机会遇到问题.

I wrote a UWP-App and after generating and installing the .appxbundle, every time I start the App I get a net_http_client_execution_error. The App is starting and running fine, when started in Visual Studio 2015. So there is no chance for me to get the problem, if I debug the app.

更新:
默认情况下,Windows 限制应用访问本地主机 (127.0.0.1).我在那里运行了一个沙发数据库.这个沙发数据库也应该为我们的客户运行.是否可以允许应用访问本地主机(启用本地网络环回)?

Update:
By default Windows restricts apps to reach the localhost (127.0.0.1). I have running a couch database there. This couch database should run there for our costumers as well. Is it possible to allow a App to reach the localhost (enable local network loopback)?

推荐答案

对于业务线应用,请使用 checknetisolation.exe 工具授予应用回送异常.

For a line of business app use the checknetisolation.exe tool to grant the app a loopback exception.

要启用环回,请使用以下命令:

To enable loopback use this command:

c:>checknetisolation loopbackexempt -a -n=<package family name>

要禁用环回,请使用以下命令:

To disable loopback use this command:

c:>checknetisolation loopbackexempt -d -n=<package family name>

UWP 应用程序的包系列名称可以在多个位置找到:Visual Studio 在打包选项卡上的 Package.appxmanifest 编辑器中显示它,PowerShell 的 get-appxpackage cmdlet 显示它,等等.它看起来像MyPackage_edj12ye0wwgwa"

The package family name for a UWP app can be found in several places: Visual Studio shows it in Package.appxmanifest editor on the packaging tab, PowerShell's get-appxpackage cmdlet displays it, etc. It will look something like "MyPackage_edj12ye0wwgwa"

在某些情况下,环回豁免会工作一段时间,然后停止工作.在这种情况下,您可能需要运行以下命令来清除/删除所有豁免项,然后将它们一一添加回来以恢复良好状态.(来自Pawel Sledzikowski 的评论)

In some cases loopback exemption will work for some time and then stop working. In this case you might need to run the following command to clean/remove all exemptions and then add them back one by one to get back in a good state. (from Pawel Sledzikowski's comment)

c:>checknetisolation loopbackexempt -c

https://https://msdn.microsoft.com/en-us/library/windows/apps/dn640582.aspx 上有一份包含更多详细信息的白皮书msdn.microsoft.com/en-us/library/windows/apps/dn640582.aspx

这篇关于UWP 启用本地网络环回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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