Grant yourself permission to bind to network adapters other than localhost, and configure IIS express to bind to all adapters.
IIS Express will then accept connections from the Android emulator via 10.0.2.2. If you add a rule to the firewall, you can also expose IIS Express to your network, which decreases security but is useful for testing physical devices.
Step details: (they assume a port number of 5555 - use your actual port instead)
Run this from a command prompt as Administrator:
netsh http add urlacl url=http://*:5555/ user="NT AUTHORITYINTERACTIVE"
In %USERPROFILE%DocumentsIISExpressconfigapplicationhost.config, replace your site's localhost binding with bindingInformation="*:5555:*"
. The result should look like this:
<site name="..." id="...">
<!-- application settings omitted for brevity -->
<bindings>
<binding protocol="http" bindingInformation="*:5555:*" />
</bindings>
</site>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…