Accessing local sites from Lan IIS Express

Accessing local sites from Lan using IIS Express

Added by Nasir Mahmood updated on Wednesday, April 9, 2014

Problem:

Sometimes it is required to view web project from Local area network rather than localhost. But Visual studio’s built in server work only for localhost. Other method is to use IIS web server.

This is step by step tutorial by which we can view our web project from Local area network by using IIS Express web server.
(Note: This tutorial is using Visual Studio 2010 & IIS Express 7.5 web server)

Prerequisites:

  • Visual Studio
  • IIS express web server must be installed on local computer

Project Properties:

First of all open Properties of web project and navigate to web page and check radio button “Use Local IIS web server”

Here in project url text box you can change port number as you want, as shown below.

Use IIS Express web server

Create Virtual Directory:

This is an important step by which we are going to create a reference entry in IIS server applications list.

Just click “Create Virtual Directory” button, if everything is ok you will see a message box displaying as shown below.

Create Virtual Directory IIS Express web server

Edit Application Configuration:

In this step we will edit applicationhost.config file which is located user documents -> IISExpress -> config folder as shown below.

edit applicationhost.config IIS Express web server

Edit applicationhost.config with your favorite editor and find site tag by site name or any other method. And add a line as shown below.

edit applicationhost.config IIS Express web server

As shown above we can add as many binding lines as we can, with different ports but same local IP address.

Result:

Now start debugging by pressing F5 and see the result as shown below.

Multiple sites IIS Express web server

As shown above we have two sites binds at different addresses. We can access our site from Local Area Network by using IP address as http://192.168.0.5:62217 and for local system by http://localhost:62217.


About

29 Tutorials
25 Snippets
6 Products

More

Contact Us

Contact us

Stay Connected