Can't see localhost from UWP app

后端 未结 1 589
孤独总比滥情好
孤独总比滥情好 2020-11-29 04:40

I’m working on UWP app on my laptop. On a previous laptop with a pre-release Windows 10, I was able to get my app to see my web API service on localhost, but on this laptop

相关标签:
1条回答
  • 2020-11-29 05:17

    It's not a bug it's a feature, called network isolation. It was introduced in Windows 8 (where Metro apps were called Windows Runtime apps).

    For security reasons, a UWP app that is installed in the standard manner is not allowed to make network calls to the device it is installed on.

    More details here and here.

    The feature can be disabled in Visual Studio debug settings, also the article How to allow loopback for Windows Runtime apps talks about using the CheckNetIsolation Windows tool to enable loopback access per application:

    CheckNetIsolation.exe LoopbackExempt -s
    
    CheckNetIsolation.exe LoopbackExempt –a –p=S-1-15-2-4125766819-3228448775-2449327860-2490758337-1264241865-3581724871-2122349299
    

    There are also GUI tools such as Enable Loopback Utility and Loopback Exemption Manager which make this task easier:

    0 讨论(0)
提交回复
热议问题