In this article we will see how to bind website to IIS and also how can we convert a Virtual Directory to WebApplication
Introduction
Binding of a ASP.NET website in Local IIS and how to convert a Virtual directory to a Web Application
Objective
- Understanding IIS
- Understanding Application Pools
- Install IIS in Windows 7 or Windows Server 2008
- How to bind a website?
- Converting a Virtual Directory to Web Application
Using the code
What is IIS ?
IIS is Internet Information Services it was earlier known as Internet Information Server i.e. it is a place where an asp.net application resides.When the user sends a request to an Website it first arrives to IIS and then to the Web Site.
With Windows 7 and Windows Server 2008 you will get IIS 7.5
Here is the Look of IIS 7.5
Application Pools
It can be termed as Worker processor as a computer processor.You can assign same Application Pool to different Application but Web Application should have same Framework.
Different Framework Website should be mapped to different Application Pools.
Here is how Application Pools Looks
If you see there are some Application Pools with named as ASP.NET v 4.0 Classic and some with the names of the website and if you look closely then it will show you also the framework they are bounded to i.e 2.0 or 4.0
Now in the following steps we will see how to Install IIS.
For Windows 7 or Windows Server 2008
To Install IIS
Go to Start -> Control Panel -> Programs and Features -> Turn Windows Features on or Off on Left top side.
Here how it is you need to check all the things that i have surrounded with rectangle to get full features of IIS
The above all the Folders should be checked and after that you will have to click OK.Please check the following Images.
After this it will start Installing the Features it will take some time and then you will have to restart the Computer.
Once it is restarted and then just type IIS in start search of Windows 7 Start Menu as seen in screen shot
Now in the IIS Manager you can bind web site and also Add Application Pool.
How to bind a Website ?
- Open IIS Manager = Start -> In search type IIS and you will see IIS Manager as you see in above screen.
- Now you will see IIS Management Console as seen in first Screen.
- Now to Add a Webite you will see a Sites folder right click on it and Click Add Website you will get the Dialog box of Add Web site.
Now we will have to add the details of the Website as in the below Screen.

- In the above screen if you see we have given the name of the Site as Test.
- Application Pool has taken the name as same of the Website name you can keep this same or assign any other pool by clicking on Select.
- Since we are binding on Local Host the IP Address is unassigned and port number you can use any number.By default it will have 80.If you have not binded any site on Port 80 then you can use Port 80 but if the port 80 is allotted to any other web app then you can customize the port as you want over we have given as 1030.
- The host name should be blank as we are binding on the local host or the name of the domain of your website if it is a Production Server
- Now Click Ok.
- Since our Test Website is working on Framework 4.0 we will have to go to Application Pool and change the Framework because by default the App Pool takes v2.0 framework, we will have to change the application pool to verion 4.0 of .NET Framework.
- To change the Framework we will have to go to Application Pool and change it as in screen below.
- If we do not change the Application Pool then it will give us target Framework Error.

Now come to the sites folder and right click on the Test Website and Browse it will run in your default Browser
Add a Virtual Directory and convert it to Web App.
- Open IIS Manager = Start -> In search type IIS and you will see IIS Manager as you see in above screen.
- Now you will see IIS Management Console as seen in first Screen.
- Now Expand the Sites folder and in that you will see Default website folder expand the default website folder and then right click the Default website and select Add Virtual Directory.
Now we will have to fill the details for the shown screen.
- Alias is the name of the Web application that you want to refer.
- Physical Path :-The place where you will have stored the Website.
Now we see a directory is created named TestApp. Now right click on the TestApp Virtual Directory and select Convert to Web Application.
Now if you see the Folder of TestApp has changed to Web Application the icon has changed.
If you are binding this on Local Lan Server than you can just call the IP address and the Appname
Eg :- If your Server is ON LAN and its ip is 192.168.25.12 and other computer is in LAN
Then from another computer you can call the Web App from the other computer the following way
This is how you can call the web app from a Server which is in LAN.
Conclusion
Hope this will be a valuable information