Tag Archive | urlacl

Allowing remote access to your IIS Express service

While developing an ASP.NET application with the IISExpress service, you might like to see how it looks on your mobile device connected to your LAN via Wi-Fi, or just any computer connected to your network.

If you do not happen to have the full IIS installed already, you can allow your IISExpress service to serve remote pages quickly and easily by following these steps.

Warning: By following these instructions you are solely liable for any security breach or problems you may face. Do not use this information if you do not agree with that statement.

Assume your machine name is ‘jedi’, and your port number is ‘16253’, replace appropriately.

1. Run a command prompt as administrator, and type in

netsh http add urlacl url=http://jedi:16253/ user=everyone

2. Open up the following file in Notepad or Visual Studio

MyDocuments\IISExpress\config\applicationhost.config

change the binding from:

<binding protocol="http" bindingInformation="*:16253:localhost" />

to:

<binding protocol="http" bindingInformation="*:16253:jedi" />

3. Restart the IISExpress service (use the tray icon or task manager, or a command prompt, type issreset).

4. In Visual Studio, change your Project->Properties->Web settings to launch http://jedi:16253 instead of http://localhost:16253

5. In a web browser on your development machine type http://jedi:16253/

6. Assuming all is good – Open up the port on the firewall.

        • Goto the Windows Firewall with Advanced Security panel
        • Create a new inbound rule
        • Click ‘Port’
        • Click ‘Next’
        • Click TCP
        • Enter a specific port 16253
        • Click ‘Next’
        • Click ‘Allow the connection’
        • Click ‘Next’
        • Click ‘Next’ (you could untick Public)
        • Give it a name “My MVC App” and press Finish.

7. You should now be able to access the page on the mobile device when connected to the Wi-Fi using http://jedi:16253/

For more advanced information see Scott Hansleman’s blog post. Also read some of the comments below where others have found problems and solutions.

Advertisements