Click here to Skip to main content
12,291,499 members (59,286 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

11.5K views
5 bookmarked
Posted

Access IIS Express Website From Remote Machine

, 7 Aug 2014 CPOL
Rate this:
Please Sign up or sign in to vote.
IIS Express Run From a Remote Machine Sometimes running a web application using IIS Express using localhost is fine, but if you want to use the IP address and port to access it from another machine then you need to configure…Read more ›Related Posts:Debugging a Windows 8 Store App on a S

IIS Express Run From a Remote Machine

Sometimes running a web application using IIS Express using localhost is fine, but if you want to use the IP address and port to access it from another machine then you need to configure IIS Express. For example if you see this error

Invalid hostname

Invalid hostname

You can get to the IIS Express settings applicationhost.config by going to IISExpress\config in your documents folder.

The important section of the config file are the sites listings

<site name="WebApplication1" id="45">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\visual_studio_projects\WebApplication1\WebApplication1" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:60106:localhost" />
</bindings>
</site>

To access it from another machine, you need to add an extra entry for the binding like this:-

<binding protocol="http" bindingInformation="*:60106:192.168.234.12" />

But after restarting IIS Express which is accessible from the try icon you may get this

Visual Studio error

Visual Studio error

Usually all you need to do is start a command console as administrator and run this command:-

netsh http add urlacl url=http://192.168.234.12:60106/ user=everyone

To delete the same urlacl run this:-

netsh http delete urlacl url=http://192.168.234.12:60106/

But sometimes that does not always work and you still cannot run the web application by its IP address. The other approach is to run Visual Studio as administrator. This can be tedious every time you start Visual Studio up, so find its executable which is usually under:-

C:\Program Files (x86)\Microsoft Visual Studio {version}\Common7\IDE

Right click the devenv.exe icon and choose properties. The select the compatibility tab.

Change the Privilege Level to run as administrator like this:-

Visual Studio .exe properties

Visual Studio .exe properties

You can also choose to change this setting for all users if you wish.

Now you should be able to run your web application from another machine such as virtual machine.

Happy coding

Related Posts:

The post Access IIS Express Website From Remote Machine appeared first on Don't Believe The Type.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Garry Pilkington
Web Developer Asterope Systems Ltd
United Kingdom United Kingdom
Software developer for over 10 years mainly creating enterprise web applications using the Microsoft .Net stack.

Owner of Asterope Systems Ltd specializing in consulting/contracting.

You may also be interested in...

Comments and Discussions

 
QuestionVisual Studio 2015 uses different configuration file Pin
Jon Eldridge21-May-15 22:14
memberJon Eldridge21-May-15 22:14 
QuestionA simpler solution Pin
Ionut-Cristian Florescu30-Apr-15 5:36
memberIonut-Cristian Florescu30-Apr-15 5:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160518.1 | Last Updated 7 Aug 2014
Article Copyright 2014 by Garry Pilkington
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid