Debugging IIS Express Sites on Mobile Devices with Visual Studio
Lee Timmins
11th Sep 2025
Comments
Step 1. Configure IIS Express for External Access
By default, IIS Express only listens on localhost. To make your site accessible from your LAN IP address:
- Locate the applicationhost.config file in your solution folder. It’s usually found under: .vs\foo\config\applicationhost.config.
- Open the file and find your site’s <bindings> section.
- Add a new binding for your machine’s local IP address (leave the existing bindings).
- For example:
<bindings>
<binding protocol="http" bindingInformation="*:11111:192.168.1.100" />
<binding protocol="https" bindingInformation="*:12345:192.168.1.100" />
</bindings>
Replace 192.168.1.100 with your computer’s LAN IP (you can find it with ipconfig).
This tells IIS Express to listen on both localhost and your LAN IP, making it reachable from other devices on the same network.
Step 2. Allow Firewall Access
Even after updating the bindings, Windows Firewall may block incoming traffic. You’ll need to add a rule to allow IIS Express:
- Open Windows Defender Firewall with Advanced Security.
- Go to Inbound Rules → New Rule.
- Choose Port, and click next, specifying the port, e.g. 12345 (TCP).
- Name the rule, e.g. "IIS Express Port 12345" and finish the wizard.
This ensures your development machine accepts requests from other devices on your Wi-Fi.
Step 3. Access Your Site from a Mobile Device
With IIS Express listening on your LAN IP and the firewall rule in place:
- Make sure your mobile device is connected to the same Wi-Fi network as your computer.
- Open a browser on your phone.
- Enter your PC’s IP and port, for example: https://192.168.1.100:12345.
Your mobile device should now load the site hosted by IIS Express. Since Visual Studio is attached to IIS Express, you can set breakpoints and debug requests made from your phone just like those from your desktop browser.
Note: If you run into access issues, check your Wi-Fi profile settings and ensure the network is set to Private:
