Access a Running Visual Studio Project via Local Network

Posted on January 28th, 2014

Just making a note of this development issue, as I’m bound to need it in future…

Problem: I have a Visual Studio project in development happily running on localhost:xxxx (random port) but I need to access it via my local network machines (specifically in this case; on my VirtualBox virtual machines running various OS’s/Browsers).

Solution:

The following code assumes that you’re logged on to your pc as user John Smith, and wish to enable local network access for a project named ‘Acme’.

Open the file:

C:\Users\John Smith\Documents\IISExpress\config\applicationhost.config

Locate the site in question:

<site name=”Acme” id=”4″>
<application path=”/” applicationPool=”Clr4IntegratedAppPool”>
<virtualDirectory path=”/” physicalPath=”E:\work\working\acme\Acme” />
</application>
<bindings>
<binding protocol=”http” bindingInformation=”localhost:52695:” />
</bindings>
</site>

Change the line:

<binding protocol=”http” bindingInformation=”localhost:52695:” />

to:

<binding protocol=”http” bindingInformation=”*:52695:” />

Then fire up a command line client (Run as Administrator) and enter:

netsh http>add urlacl url=http://*:52695/ user="local_network_name\john smith"

replacing local_network_name as appropriate.

You should now be able to access the running project via other machines on the network, by navigating to

http://machine_name:port

for the running project (e.g.: http://Dell-6SRR25J:52695).

Add a Comment

You must be logged in to post a comment.