How to run localhost websites on Microsoft Edge

Hello!
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

For previous builds:

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

The previous command uses the App container name parameter “n“.

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

Happy browsing!

Posted in Web Development Tagged with: ,