How to debug localhost on Microsoft Edge


Cross-post from my blog
--------------------------------------------

Hello Developers!
You might have already heard that Windows 10 will run Microsoft Edge an all-new browser that’s built to give you a better web experience. Microsoft Edge is the browser for the modern web. If you are developer you might be really interested in the Dev center for the new browser, you can check it on this link http://dev.modern.ie/. There you will find lots of tools and resources and you can also:

  • Check Platform Status
  • Test and debug your site with free tools
  • Explore Demos
  • View standards roadmap
  • Give feedback and suggest features
  • Get Support

Anyways, back to the main topic. How to run/debug a localhost website on Microsoft Edge. You most likely will run/debug a website locally on Edge since it the default Browser of Windows 10. Problem arises when you do so and you will have an error, something like the following screenshot(Build 10130):

 

 

 

This happens because Edge runs as a Windows modern app different from IE and thus it is has network isolation by default for security reasons. In order to resolve this issue, we need to enable loopback and debug the localhost server by running the following command from an elevated shell (which I found in the FAQs page on MSEdge Dev) :

For Build 10158 or newer:

CheckNetIsolation LoopbackExempt -a -n=Microsoft.MicrosoftEdge_8wekyb3d8bbwe

PS:Some users got an "invalid parameter error" and as suggested by the comment from our reader below (Steve). Adding quotes seems to do the job:

CheckNetIsolation LoopbackExempt -a -n="Microsoft.MicrosoftEdge_8wekyb3d8bbwe"

For previous builds:

CheckNetIsolation LoopbackExempt -a -n=Microsoft.Windows.Spartan_cw5n1h2txyewy

You can read more on loopback exemption and network isolation in Windows Runtime apps on this MSDN article.

Happy browsing!

Comments (5)

  1. Error: Invalid Parameters

    on 10162

  2. Boeki Tongco says:

    same here on 10162:

    CheckNetIsolation LoopbackExempt -a -n=Microsoft.MicrosoftEdge_8wekyb3d8bbwe

    >>>

    Error: Invalid Parameters

  3. Steve Thompson says:

    It seems this works if you put quotes around the package name at the end:

    CheckNetIsolation LoopbackExempt -a -n="Microsoft.MicrosoftEdge_8wekyb3d8bbwe"

  4. Arian Kulp says:

    Thank you, Steve Thompson.  Hopefully Rami will update his post soon.

  5. Thanks Steve! Although i tried it without quotes and it worked for me on Build 10162. Nevertheless, I will update the post with your recommendation

Skip to main content