Troubleshooting UWP App Local Network Connectivity
Problem:
UWP applications often encounter a "net_http_client_execution_error" during installation when attempting to access localhost (127.0.0.1). This error prevents debugging, as it doesn't occur when running the app within Visual Studio.
Solution:
Enabling local network loopback access for your UWP app is achievable through the checknetisolation
command-line tool. This is a targeted solution for specific applications.
Procedure:
Identify the Package Family Name:
Package.appxmanifest
editor. The Package Family Name is visible there.Get-AppxPackage
to list installed packages and locate your app's Package Family Name.Enable Loopback Exemption:
Open an elevated command prompt (Run as Administrator).
Execute the following command, replacing <package family name>
with the actual name from step 1:
<code class="language-cmd">checknetisolation loopbackexempt -a -n=<package family name></code>
Revoke Loopback Exemption (Optional):
To disable loopback access for the app, use this command (again, replace <package family name>
):
<code class="language-cmd">checknetisolation loopbackexempt -d -n=<package family name></code>
Important Considerations:
If loopback access unexpectedly ceases to function, consider clearing all existing exemptions using:
<code class="language-cmd">checknetisolation loopbackexempt -c</code>
For comprehensive information, refer to the official Microsoft documentation (link may vary, search for "UWP Network Restrictions").
The above is the detailed content of How to Enable Local Network Loopback for UWP Apps Facing 'net_http_client_execution_error'?. For more information, please follow other related articles on the PHP Chinese website!