Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Troubleshooting UWP Network LoopbackExcempt

I am developing an UWP Application that should be able to accept incomming TCP connections.

I have given it the following capabilities in the package manifest:

  • Internet (Client)
  • Internet (Client/Server)
  • Private Networks (Client/Server)

I am using the StreamSocketListener from Windows.Networking.Sockets

Connections from other devices are established just fine.

Hovever: I can not connect from my own device over the loopback interface

As per this document from Microsoft, UWP does indeed restrict connections over the loopback interface, but:

Apps installed and run in Visual Studio will automatically be registered as being exempt from the loopback restrictions.

This is the scenario I'm in. And checking the Debug section in the application properties reveals that the Allow local network loopback is checked.

I checked the loopback excemptions on the system via

CheckNetIsolation.exe LoopbackExempt -s

My apps SID does appear in the list.

A comment under this SO answer suggested clearing the list and adding each entry manually. This did not resolve the problem.

Other things I have attempted:

  • Changing the release version of the App (Did not help)
  • Uninstalling and redeploying the App (Didi not help)
  • Setting up a fresh project. (Did not help)
  • Rebooting the system. (Did not help)
  • Using my LAN IP Address instead of the Loopback Address (Did not help)
  • Bashing my head against the wall (Did not help)

So the final question:

How can I enable loopback connections to a UWP app despite doing every step nescessary

Has anybody further experience with this? Is there some hidden trick I need to perform so I can connect from the local device?

like image 788
MrPaulch Avatar asked Apr 19 '26 09:04

MrPaulch


1 Answers

If you have more than 682 records CheckNetIsolation.exe LoopbackExempt -s none of your app will be exempted. I don't know why. Try to delete temp apps with PowerShell:

Get-AppxPackage *app.a* | Remove-AppxPackage

This helped me a lot.

like image 137
Jet Chopper Avatar answered Apr 22 '26 06:04

Jet Chopper



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!