Thursday, October 9, 2014

Remote access to IIS Express

If you try to access the IIS Express website from a remote computer, you wont be able to do it unless you follow these steps.

Steps:

Open C:\Users\[YourName]\Documents\IISExpress\config\applicationhost.config 
Look for <sites> section
In there find your site

<site name="MyWeb" id="2">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="E:\MyWeb" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:52891:localhost" />
        <binding protocol="http" bindingInformation="*:8080:192.168.1.6" />
    </bindings>
</site>

Now, create another binding as highlighted. IP address is your computers' IP, port is whatever the port you want.

Allow incoming connections: Open command prompt as admin
netsh http add urlacl url=http://192.168.1.6:8080/ user=everyone
Open firewall:
netsh advfirewall firewall add rule name="IISExpressWeb" dir=in protocol=tcp localport=8080 profile=private remoteip=localsubnet action=allow