Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UWP Enable local network loopback

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.

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)?

like image 474
M4s0n Avatar asked Oct 21 '15 12:10

M4s0n


People also ask

How do I enable localhost loopback?

To enable loopback for client connections use CheckNetIsolation.exe LoopbackExempt -a -n=<AppContainer or Package Family> . CheckNetIsolation.exe will configure loopback for the application and exit. This will enable the application to make outbound connections to a server.

How do you exempt the Minecraft client from UWP loopback restrictions?

For example, Windows 10 Minecraft UWP app can't connect to a server hosted on the same PC. To resolve the issue, you need to add the app in question to the Windows 10 loopback exempt list using PowerShell CheckNetIsolation LoopbackExempt command. CheckNetIsolation LoopbackExempt -a -n="Microsoft.


1 Answers

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> 

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"

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 

There is a whitepaper with more details at https://msdn.microsoft.com/en-us/library/windows/apps/dn640582.aspx

like image 170
Rob Caplan - MSFT Avatar answered Sep 22 '22 18:09

Rob Caplan - MSFT