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?
相关问题
- How to access the camera from my Windows Phone 8 a
- How to append a file, asynchronously in Windows Ph
- Save pictures to custom folder in media library
- localhost refuses to connect - ERR_CONNECTION_REFU
- MAMP Pro 3 “The installation failed.”
相关文章
- Codeigniter remove index.php - htaccess localhost
- LongListSelector on WP8 linq-to-sql binding issue
- How to free image cache/memory in Windows Phone 8?
- How to Play youtube videos in windows phone 7?
- Custom Panel with Reorder and animations / transit
- WP8 HttpClient.PostAsync never returns result
- Windows Phone Phonecall with dtmf
- Running a php script using wget and Windows Schedu
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.
I was looking for an answer for this too and found out there is now an official answer from Microsoft at:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj684580%28v=vs.105%29.aspx
I had this is problem when I was running my cordova app with windows phone 8 emulator. In my case I was running my app in release mode. When I change the mode to debug I was able to access local web server from my app.
http://guntucomputerhacks.blogspot.com.au/
You can install fiddler and go through the instruction on how to configure fiddler for windows emulator.
This article worked just fine for me: http://blogs.msdn.com/b/wsdevsol/archive/2013/06/05/configure-the-windows-phone-8-emulator-to-work-with-fiddler.aspx
One the configuration is done, emulator will automatically use fiddler as a proxy server and you localhost should work just fine from emulator too.
Remember to start fiddler before starting the emulator to route the traffic, otherwise it wont work. You will also be able to monitor http/https requests made by windows emulator.
Try to use your IP instead of using (localhost)
1- from start menu open command prompt 2- write ipconfig 3- you will find your ip address beside ipv4 adress if it doesn't work try those additional steps from MSDN
To create a firewall exception for HTTP requests to IIS Express From the Windows Start screen, search for Windows Firewall. Click to run the program. On the Windows Firewall screen, click Advanced settings. On the Windows Firewall with Advanced Security screen, select Inbound Rules. Then click New Rule. On the Rule Type page of the New Inbound Rule Wizard, select Port. Then click Next. On the Protocols and Ports page, enter the port number that IIS Express is using in the Specific local ports field. Then click Next.
On the Action page, select Allow the connection. Then click Next. On the Profile page, select Private and, if applicable, Domain. Do not select Public. Then click Next. On the Name page, type a name for the rule – for example, Local web service for testing. Then click Finish.