Frage

I was in two minds about whether this post belongs on Stack Overflow or Server Fault so if I have the wrong area then apologies! I chose Server Fault as I believe the only difference between a previous working solution and the current issue I have is IIS Express.

I have successfully used SPI Port Forward to test local websites mid-development when using Visual Studio 2010 but with the upgrade to Visual Studio 2013 and the inclusion of IIS Express I am no longer able to see my website when browsing from another device on the same network. As you can imagine such functionality is priceless when testing on mobile devices as it means I don't have to publish the site anywhere before testing.

Any ideas?

War es hilfreich?

Lösung

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:

  1. Ignore SPI Port Forward, you don't need it anymore with IIS Express.
  2. Go to: C:\Users{Windows username}\Documents\IISExpress\config (In VS 2015 look in {Solution root folder}\.vs\config)
  3. Open the file named "applicationhost.config" in your text editor of choice.
  4. Find the site that you are looking to expose on your local network.
  5. 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.
  6. 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
  7. 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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top