Answer updated to include VS 2015 path change of applicationhost.config file.
I've been frustrated by this for a while without investing too much time into it and typically once I finally post a question one of my colleagues who has also been trying has found a solution!
Here goes:
- Ignore SPI Port Forward, you don't need it anymore with IIS Express.
- Go to: C:\Users{Windows username}\Documents\IISExpress\config (In VS 2015 look in {Solution root folder}\.vs\config)
- Open the file named "applicationhost.config" in your text editor of choice.
- Find the site that you are looking to expose on your local network.
- Add a new binding after the existing one "" where 8080 is the port you want to expose the site with and 192.168.0.2 is your local network IP. Save the file.
- Run the following in cmd with the same port and IP substitution you applied in point 5:
netsh http add urlacl url=http://192.168.0.2:8080/ user=everyone
- Run the following in cmd with the same port substitution again:
netsh advfirewall firewall add rule name="IISExpressWeb" dir=in protocol=tcp localport=8080 profile=domain remoteip=localsubnet action=allow
. I've named the firewall rule IISExpressWeb in this example, you can call it whatever you like!
I can now view my local development server on mobile devices for testing purposes! You'll need to stop and start IIS Express for the changes to take effect.
Hope this helps.