Windows Phone 8 Emulator: Access localhost

brijshah picture brijshah · Oct 31, 2012 · Viewed 16.3k times · Source

I created MVC4 Mobile Application using VS 2012 default template. It's working fine in desktop browser using http://localhost/mvcapplication1/ but when I tried running the same app in WP8 Emulator browser it's not working and showing message "We're having trouble displaying this page". I also tried with IP address (127.0.0.1) but still no luck. Please tell me how can I connect to localhost using WP8 Emulator browser?

Answer

SLaks picture SLaks · Oct 31, 2012

The Windows Phone 8 emulator is actually a full virtual machine with its own internal IP address.
Therefore, localhost means the (virtual) phone, not your PC.

To connect to the host PC, you need to enter its internal IP address.

You also need to configure IIS Express and your firewall to accept connections from other computers.