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)
- Visual Studio
- IIS express web server must be installed on local computer
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.
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.
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 with your favorite editor and find site tag by site name or any other method. And add a line as shown below.
As shown above we can add as many binding lines as we can, with different ports but same local IP address.
Now start debugging by pressing F5 and see the result as shown below.
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.