简体   繁体   中英

Access local host website from Android Device

I have created web services application in asp.net mvc and now need to access it from my Android device connected on same network. This is needed to debug webservies application. I do not have a static IP. The site is running with url http://localhost:27719 but I cannot access localhost from Android device. I researched web and tried below options: Tried changing website binding information in applicationhost.config file. But I couldn't find my webstie entry in applicationhost file. I have also tried opening the specific port 27719 in windows firewall. But that isn't working too. I am able to access website if I host on IIS. But I need to access it when I run from Visual Studio, so that I can debug. Please suggest how can I access webservices on my machine from Android device connected to same wifi network.

In the menu at the top of the window in Visual Studio, go to Debug, then Attach to Process (alternatively, press Control Alt P on your keyboard). It will ask you which process to attach to. Choose w3wp.exe and press Attach. The debugger will then connect to your site in IIS, and you'll be able to debug when the Android device is connected to the site.

It should be noted that you'll need to provide the IP of the server in the URL on your Android device, not "localhost".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM