2

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?

MrPaulch
  • 1,423
  • 17
  • 21

2 Answers2

1

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.

Jet Chopper
  • 1,478
  • 13
  • 22
  • That is indeed an odd number and bug. "Sadly" not the case on my system. I had only 2 temp apps. But maybe someone else will benefit of this. Thanks. – MrPaulch Sep 12 '17 at 11:34
0

I had also come across a similar situation, I had resolved this using Fiddler which comes with a tool WinConfig in its menubar to restrict LoopbackExempt.

Ipsit Gaur
  • 2,872
  • 1
  • 23
  • 38
  • I'd like to avoid third party applications to resolve this matter. But maybe I will give it a shot once I grow more desperate. Thank you. – MrPaulch Sep 12 '17 at 11:25