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:
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".
Grant Loopback Access: Open an elevated command prompt (run as administrator) and execute this command, replacing <package family name>
with your app's actual package family name:
<code>c:\>checknetisolation loopbackexempt -a -n=<package family name></code>
<code>c:\>checknetisolation loopbackexempt -d -n=<package family name></code>
<code>c:\>checknetisolation loopbackexempt -c</code>
Important Considerations:
The above is the detailed content of How Do I Fix 'net_http_client_execution_error' When My UWP App Accesses localhost?. For more information, please follow other related articles on the PHP Chinese website!