Can't open localhost in Microsoft Edge (Project Spartan) in Windows 10 preview
IisBrowserWindows 10Microsoft EdgeIis Problem Overview
I installed Windows 10 preview and installed IIS.
Open "http://localhost" in Project Spartan can't connect.
IE has no problem. What's the problem?
Iis Solutions
Solution 1 - Iis
So the issue is Spartan Edge doesn't have access to the loopback addresses, which is something that most Windows Store apps are blocked from accessing.
If you are using Windows 10 RTM or build 10166, this can be done by navigating to about:flags
and checking "Allow localhost loopback":
Image courtesy of Ryan Joy and used with consent.
If you are using a previous build of Windows 10, the CheckNetIsolation
tool can be used to add it to the LoopbackExempt list. Use this from an elevated command prompt:
CheckNetIsolation LoopbackExempt -a -n="Microsoft.MicrosoftEdge_8wekyb3d8bbwe"
Microsoft.MicrosoftEdge_8wekyb3d8bbwe
is the identifier for the Edge app. It can be determined by using Get-AppxPackage
in PowerShell and sifting through the results for the Spartan / Edge and using the PackageFamilyName
.
As of Build 10158, the PackageFamilyName has changed from Microsoft.Windows.Spartan_cw5n1h2txyewy
to Microsoft.MicrosoftEdge_8wekyb3d8bbwe
.
Solution 2 - Iis
Microsoft Edge runs with network isolation by default for security reasons. To enable loopback and debug your localhost server run the following command from an elevated shell if you have 10158 or newer:
CheckNetIsolation LoopbackExempt -a -n=Microsoft.MicrosoftEdge_8wekyb3d8bbwe
or
checknetisolation loopbackexempt -a -p=S-1-15-2-3624051433-2125758914-1423191267-1740899205-1073925389-3782572162-737981194
or this one if you have an older version
CheckNetIsolation LoopbackExempt -a -n=Microsoft.Windows.Spartan_cw5n1h2txyewy
In a future update, you’ll be able to enable localhost loopback support using about:flags.
Solution 3 - Iis
For the latest build (10158), the following command did it for me:
CheckNetIsolation LoopbackExempt -a -n=Microsoft.MicrosoftEdge_8wekyb3d8bbwe
The trick is to use the Get-AppxPackage
PowerShell command to find out the family name of Edge app as vcsjones mentioned.
Solution 4 - Iis
As of Windows 10 Build 10166+ (available today via Windows Insider), localhost access is available by default in Microsoft Edge without running the CheckNetIsolation command listed in previous answers.
You can disable this access via "about:flags", if you wish to have an even more secure configuration.
Solution 5 - Iis
Please follow to following steps:
> 1.
> 2.
Copy this code
> CheckNetIsolation LoopbackExempt -a -n=Microsoft.MicrosoftEdge_8wekyb3d8bbwe
> 3.
**
> Job Done!
Solution 6 - Iis
Add subdomain to C:\Windows\System32\drivers\etc\hosts (Windows 10)
Solution 7 - Iis
Navigate to C:\Windows\System32\drivers\etc save hosts file copy for backup open hosts file as administrator delete or comment out any lines with 127.x.x.x or localhost...
restart pc.
Solution 8 - Iis
Neither did the CheckNetIsolation LoopbackExempt -a -n=Microsoft.MicrosoftEdge_8wekyb3d8bbwe
command nor manually enabling the "Allow localhost loopback" on Edge work for me.
What did work is the following:
-
Edit the
C:\Windows\System32\drivers\etc\hosts
file and add a mapping for a custom hostname to 127.0.0.1 like127.0.0.1 local
. -
Open Internet Options and add http://local to the local intranet sites.