Debug ASP.NET and Android without the Internet

I have an ASP.NET MVC Web Application that displays on my Android device in an Android Application with WebView activity.

When both android and android devices are in the same internet connection, I can debug using Visual Studio 2012 and IIS Express wirelessly.

Soon I need to demonstrate the application at a conference where I will not have access to the Internet. Can I perform wireless debugging without the Internet?

I was looking for a solution, but can not find one that works. I investigated an attempt to pair a device or configure my laptop as a virtual device, but none of them worked for me.

+7
source share
3 answers

You can configure your Windows 7 laptop as a WIFI access point.

right-click the Cmd.exe link and select Run as Administrator.

Now enter the following command:

 netsh wlan set hostednetwork mode=allow ssid=MyNet key=MyPassword 

and press [Enter]. Replace “MyNet” with the name you want to use for your network, and “MyPassword” with a password that is a little more difficult to guess.

Still at the command prompt, type

 netsh wlan start hostednetwork 

and press [Enter] to start the virtual adapter.

Now click "Control Panel"> "Network and Internet"> "Network and Sharing Center"> "Change adapter settings", right-click your Internet connection and select "Properties". Go to the "Sharing" tab, check the box "Allow other network users to connect ...", select your virtual Wi-Fi adapter.

From here you can see the Wi-Fi hotspot on your Android device. Once connected, you should be able to follow the usual debugging methods used on the same network.


Just like the added extra, I'm sure you know this, but for those who are looking for this, it can also help wirelessly debug your Android device.

When debugging locally (and not on android), it's enough to just use the localhost: port address. However, when you use your Android (or other devices, such as UIWebView on iOS), you cannot access this address, therefore, to get around this, you can configure your ip as an address, but there are a few steps that you must take it first.

Make sure you have the latest IIS setting installed, first get your ip (cmd.exe> ​​ipconfig) In this example, I will use 192.168.1.42 as my ip number and 58938 as the port number.

  • Add <binding protocol="http" bindingInformation="*:58938:192.168.1.42" /> to applicationhost.config after binding for 'localhost'.
  • Run netsh http add urlacl url=http://192.168.1.42:58938/ user=everyone
  • Run netsh advfirewall firewall add rule name="IISExpressWeb" dir=in protocol=tcp localport=58938 profile=private remoteip=localsubnet action=allow

Source: Johan Drissen

+2
source

If an ASP.NET application does not need to connect to the Internet, this is possible. You just need to host your web application and Android phone on the same wireless LAN. I used to debug my Android application using a web application powered by Django. This method works.

+1
source

Do you want to debug the application or just show how it works on your Android phone?

If you just need to show how it works on your phone, open port 80 on your computer and it will work perfectly on your Android device.

-one
source

All Articles