"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > How to solve the "net_http_client_execution_error" error when UWP application accesses localhost?

How to solve the "net_http_client_execution_error" error when UWP application accesses localhost?

Posted on 2025-04-16
Browse:703

How Do I Fix

Troubleshooting Network Loopback Restrictions in UWP Apps

Problem:

UWP applications attempting to connect to a local CouchDB instance (or similar local server) on "localhost" (127.0.0.1) may fail with a "net_http_client_execution_error".

Cause:

Windows' default security settings restrict UWP apps from accessing localhost to enhance network security.

Resolution:

To permit localhost access for your UWP application, follow these steps:

  1. Find Your Package Family Name: Locate your UWP app's package family name. You can find this using Visual Studio 2015's Package.appxmanifest editor or the PowerShell command Get-AppxPackage. The name will have a format like "MyPackage_edj12ye0wwgwa".

  2. Grant Loopback Access: Open an elevated command prompt (run as administrator) and execute this command, replacing with your app's actual package family name:

c:\>checknetisolation loopbackexempt -a -n=
  1. (Optional) Revoke Loopback Access: To remove the loopback exemption, use this command in an elevated command prompt:
c:\>checknetisolation loopbackexempt -d -n=
  1. Reset Loopback Exemptions (if needed): If loopback exemptions become unreliable, clear all exemptions and reapply them individually using:
c:\>checknetisolation loopbackexempt -c

Important Considerations:

Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3