Click here to Skip to main content
11,923,046 members (63,741 online)
Click here to Skip to main content
Add your own
alternative version


279 bookmarked

Deploying ASP.NET Websites on IIS 7.0

, 4 Sep 2008 CPOL
Rate this:
Please Sign up or sign in to vote.
This article describes some features and architecture of IIS 7.0 and deployment of ASP.NET sites on IIS


  1. Introduction to IIS 7.0
  2. Features of IIS 7.0
  3. Basic Architecture of IIS 7.0
  4. How to Deploy ASP.NET Websites on IIS 7.0
  5. How to Create Application Pool
  6. Assign Application Pool To Your Application
  7. Configure Web Garden on IIS 7.0
  8. IIS 6.0 Vs IIS 7.0
  9. Where Do I Get IIS 7.0
  10. References
  11. History

Introduction to IIS 7.0

Microsoft Internet Information Services (IIS) 7.0 in Windows Server 2008 and Windows Vista provides a secure, manageable platform for developing and administrating and hosting Web applications and services. It has been completely redesigned and Restructured .IIS 7.0 provides features and functionality for administrators to effectively manage Web infrastructures; developers to rapidly build Web applications and services; and hosters to Web hosting.


Features of IIS 7.0

Following are some features of IIS 7.0:

  • IIS 7.0 provides features and functionality that enable administrators to reliably and effectively manage Web infrastructures.
  • IIS 7.0 has a distributed file-based configuration system that enables IIS settings to be stored in web.config files along with the ASP.NET settings.
  • IIS 7.0 provides a cost-effective, more scalable Web server platform for delivering reliable Web hosting to a broad set of customers.

Major innovations in IIS 7.0:

  • A modular, extensible core Web server
  • A unified, distributed file-based configuration system
  • Integrated health monitoring and diagnostics
  • A set of new administration tools with delegation support

For more features and product understanding, check here.

Basic Architecture of IIS 7.0

The following diagram shows the Overall Architecture of IIS 7.0 which contains HTTP.Sys, SvcHost.exe, Application Pool and Worker Process(W3Wp).


The main components of IIS 7.0 are HTTP.Sys, Svchost.Exe, Application Pool , Worker Process (W3WP.exe) and Configuration Store.

HTTP.Sys: It the Kernel mode Protocol stack which listens to the HTTP and HTTPS Request. W3SVC and WAS are the parts of Svchost.exe. W3SVC is the Listener of Request from kernel mode that is passed by the HTTP.Sys. W3SVC also interacts with Windows Activation Process which is managed by the worker process by starting, stopping and recycling the application pool. It was also responsible for Health Monitor of Application Pool during runtime. Configuration stores all web.config and ASP.NET Settings and other configuration in XML Hierarchy form. W3wp.exe is a long-running process that processes requests and generates responses.

The following diagram shows you the process flow of IIS 7.0. This is the flow of User Request to IIS and gets the Response from IIS.


User Request Pass from Kernel Level to User Level Via Http.Sys and then passes to svchost, and then goes to Application Pool.

For more details, please click here.

How to Deploy ASP. Net Websites on IIS 7.0

From now onwards, I will describe one example to deploy your ASP.NET websites on IIS 7.0.

Step 1: From Visual Studio, publish your Web application.

Step 2: Copy the published application folder to "C:\intepub\wwwroot" [default] folder.

Step 3: From RUN - > inetmgr -> OK

The following screen will come. This is the main page for any application. There are three panels.


"TestWeb" is a recently pasted webapplication on your wwwroot folder.

Step 4: We need to convert it to an application, just right click and then Click on "ConvertToApplication" as shown in the following picture:


After converting it to application, its icon will be changed and then you can set the property for your web application from the middle pane. You can set IIS Authentication Mode, Default Page Just like IIS 6.0:


You can change Security Settings on Authentication Section. By default Setting will be set from your web.config itself. As in my web.config Form Authentication was set that's why, Forms Authentication has been Enabled. If we want to change the status, just double click and update status to Enabled to Disabled or Vice Versa.


Now one most important part is to set the Application Pool for your application.

How to Create Application Pool

A site can contain many applications including that site’s default application, which is called the root application. In addition to belonging to a site, an application belongs to an application pool, which isolates the application from applications in other application pools on the server .

Step 1: Right Click on Application Pool and give the name of your pool. Here, I have given "pool" and select Framework and click on OK:


Step 2: If you are writing some thing on the server [may be writes Error Events Logs], you need to change the Pool Identity to Local System. Right click on Pool Identity setting as shown in the following image:

There are three identities of Application Pool:

  • Network Service
  • Local Service
  • Local System

Assign Application Pool To Your Application

Now, we need to assign the Application Pool to our web application.

Step 1: Right Click on "TestWeb" Application and Select "Advanced Settings":


Step 2: Finally assign your created Application Pool "pool" to "TestWeb" Application.


Now you can run your application by just typing http:\\localhost\testweb and it can be accessible on network by IP also.

Configure Web Gardens in IIS 7.0

I have split this section into some parts. These are:

What is Application Pool ?

Application pools are used to separate set of IIS worker processes that share the same configuration. Application pools enable us to isolate our web application for better security, reliability, and availability. The worker process serves as the process boundary that separates each application pool so that when one worker process or application is having an issue, other applications or worker processes are not affected.


Figure: Application Pool With Worker Process On IIS Server

In your IIS, there may be more on Web sites hosted and by creating Application Pool, you can just assign a Separate Worker Process to your application. I have already discussed how you can assign Application Pool to your web application.

Types of Application Pools

There are two predefined Application Pools is IIS 7.0:

  1. DefaultAppPool (Integrated)
  2. ClassicAppPool

None of the Application Pools are Installed by default when IIS 7.0 is installed. Classic Application Pool is installed when ASP.NET 2.0 is installed in the System.

Identity Of Application Pool

Application pool identity configuration is an important aspect of security in IIS 7.0, because it determines the identity of the worker process when the process is accessing resource. This Settings comes form IIS 6.0. in IIS 5.0. There the Application pool runs under the local system account. In IIS 7.0, there are three predefined Identities that are the same as IIS 6.0

Applicationpool Identity Description
LocalSystem LocalSystem is a built-in account that has administrative privileges on the server. It can access both local and remote resources
LocalServices LocalServices built-in account has privileges of an authenticated local user account. It does not have any network access permission.
NetworkServices This is the default Identity of Application Pool. NetworkServices has privileges of authenticated local user account and it can have access remote resource as machine account.

How to Create An Application Pool and Assign It to a Web Application?

This has already been discussed.

Creating Application Pool and Assigning it to a Web Application

What is Web Garden?

By default each Application Pool runs with a Single Worker Process (W3Wp.exe). We can assign multiple Worker Processes With a Single Application Pool. An Application Poll with multiple Worker process is called "Web Gardens". Many worker processes with the same Application Pool can sometimes provide better throughput performance and application response time. And each worker process should have their own Thread and Own Memory space.


Fig: General Block Diagram of Web Garden.

As given in the picture, in IIS Server there may be multiple Applicationpool and each application pool has at least a single Worker Process. Web Garden should contain multiple Worker processes.

There are certain restrictions to use Web Garden with your web application. If we use Session Mode to "in proc", our application will not work correctly because session will be handled by different Worker Process. To avoid this type of problem, we should have to use Session Mode "out proc" and we can use "Session State Server" or "SQL-Server Session State".

Main Advantage: The worker processes in a Web garden shares the requests that arrive for that particular application pool. If a worker process fails, another worker process can continue to process requests.

How to Create Web Garden?

Create a New Application Pool. Right Click -> Advance Setting -> Go To Process Model Section, set the Value for Maximum Worker Process.


Is It Recommended to use Web Garden?

It not always recommended to use Web Garden to your Application. It effects the performance of your sites except in very specific cases like some long running synchronous requests or application is very unstable.

IIS 6.0 Vs IIS 7.0

The main advantages of IIS 7.0 is Modular Design which gives some benefits to IIS 7.0 over IIS 6.0. The following table shows you some differences of IIS 6.0 and IIS 7.0.


IIS 6.0

IIS 7.0

Architecture Monolithic Modular
Setup Most Features Installed Minimum installation based on role
Extended Features ISAPI Filter and ISAPI Extension Added Module and handler in managed or native code
Customize UI Normal Customize for .NET

There are many more differences.

Where Do I Get IIS 7.0

IIS 7.0 will not be available with all Operating Systems. There are some specific OS and specific Versions for IIS 7.0.

Operating System With Edition Available
Windows Server 2008 Yes
Windows Vista (Home Basic) No (Default) need to install
Windows Vista (Home Premium) No (Default) need to install
Windows Vista (Business) Yes
Windows Vista (Ultimate) Yes



  • 08/20/2008:
    • Article published
  • 08/28/2008:
    • Added Section: Web Garden on IIS 7.0
    • Modified some text


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


About the Author

Abhijit Jana
Technical Lead
India India
.NET Consultant | Former Microsoft MVP - ASP.NET | CodeProject MVP, Mentor, Insiders| Technology Evangelist | Author | Speaker | Geek | Blogger | Husband

Blog :
Web Site :
Twitter : @AbhijitJana
My Kinect Book : Kinect for Windows SDK Programming Guide

You may also be interested in...

Comments and Discussions

QuestionIIS 7 Pin
Avantha Siriwardana10-Dec-14 20:02
memberAvantha Siriwardana10-Dec-14 20:02 
GeneralMy vote of 5 Pin
Aravindba22-May-14 2:21
professionalAravindba22-May-14 2:21 
QuestionHTTP Error 404.0 - Not Found Pin
Deepak Kr Meena6-Apr-14 21:05
memberDeepak Kr Meena6-Apr-14 21:05 
GeneralMy vote of 5 Pin
Maimonides28-Jul-13 4:38
memberMaimonides28-Jul-13 4:38 
QuestionProblem Related Remote Connection On IIS Local Host Pin
Sourabhghosh20-Jun-13 23:04
memberSourabhghosh20-Jun-13 23:04 
Questionjqueries and javascripts of my websetup are not working after creating websetup Pin
Kunalchatterjee12-Jun-13 12:16
memberKunalchatterjee12-Jun-13 12:16 
QuestionDid not work for me this way... but worked other way . what is the difference Pin
nainakarri6-Jun-13 20:12
membernainakarri6-Jun-13 20:12 
GeneralMy vote of 5 Pin
Itz.Irshad5-May-13 20:14
memberItz.Irshad5-May-13 20:14 
GeneralMy vote of 1 Pin
R koyee20-Mar-13 22:24
memberR koyee20-Mar-13 22:24 
Questionits working Pin
Amitkala2-Mar-13 22:45
memberAmitkala2-Mar-13 22:45 
QuestionSqlserver database commands are not working Pin
Member 878084223-Feb-13 9:56
memberMember 878084223-Feb-13 9:56 
GeneralMy vote of 5 Pin
dpalash5-Feb-13 19:50
memberdpalash5-Feb-13 19:50 
GeneralMy vote of 5 Pin
Maddy_10089-Jan-13 0:17
memberMaddy_10089-Jan-13 0:17 
QuestionCaution/ Recommendation Pin
Member 212708910-Dec-12 5:00
memberMember 212708910-Dec-12 5:00 
GeneralMy vote of 5 Pin
ANJYR29-Aug-12 6:25
memberANJYR29-Aug-12 6:25 
QuestionIIS7 configuration error Pin
hariom_soni18-Aug-12 5:11
memberhariom_soni18-Aug-12 5:11 
AnswerRe: IIS7 configuration error Pin
shahnawaz92863-Feb-13 20:53
membershahnawaz92863-Feb-13 20:53 
QuestionNice Article Pin
Suvabrata Roy19-Jul-12 22:55
memberSuvabrata Roy19-Jul-12 22:55 
GeneralSession Problem Pin
Member 927399818-Jul-12 11:33
memberMember 927399818-Jul-12 11:33 
GeneralNice Artical Thanks... Pin
Suvabrata Roy11-Jul-12 22:06
memberSuvabrata Roy11-Jul-12 22:06 
Questiongreta article Pin
Member 868709415-May-12 16:19
memberMember 868709415-May-12 16:19 
GeneralMy Vote of 5 Pin
Shahin Khorshidnia12-May-12 20:37
memberShahin Khorshidnia12-May-12 20:37 
GeneralMy vote of 5 Pin
sravani.v7-May-12 19:32
membersravani.v7-May-12 19:32 
GeneralMy vote of 5 Pin
manoj kumar choubey2-Apr-12 23:15
membermanoj kumar choubey2-Apr-12 23:15 
QuestionGreat article !!!! Pin
Shay Yannay23-Feb-12 3:33
memberShay Yannay23-Feb-12 3:33 
QuestionMy ASP.NET Still Error Pin
yugastio16-Feb-12 16:31
memberyugastio16-Feb-12 16:31 
Questionmy programs on/off shows a blank window hthen how i am able to install iis Pin
Member 86266366-Feb-12 21:00
memberMember 86266366-Feb-12 21:00 
GeneralMy vote of 5 Pin
mojmos15-Nov-11 22:39
membermojmos15-Nov-11 22:39 
GeneralMy vote of 5 Pin
supriya chaladi10-Nov-11 20:58
membersupriya chaladi10-Nov-11 20:58 
QuestionIs there a way to automate this? Pin
yaron klodovski22-Jun-11 0:58
memberyaron klodovski22-Jun-11 0:58 
GeneralURL Re-Wrtie with IIS - 7 Pin
indSoftware15-Mar-11 20:04
memberindSoftware15-Mar-11 20:04 
GeneralRe redirection to Login.aspx Pin
Ajay Kale New9-Sep-10 3:51
memberAjay Kale New9-Sep-10 3:51 
GeneralSolved my Problem Pin
Prakash Varun 201023-Aug-10 9:29
memberPrakash Varun 201023-Aug-10 9:29 
AnswerRe: Solved my Problem Pin
Abhijit Jana27-Aug-10 9:14
mvpAbhijit Jana27-Aug-10 9:14 
GeneralMy vote of 5 Pin
bigbulldawg5-Aug-10 4:19
memberbigbulldawg5-Aug-10 4:19 
GeneralRe: My vote of 5 Pin
Abhijit Jana27-Aug-10 9:15
mvpAbhijit Jana27-Aug-10 9:15 
GeneralMy vote of 4 Pin
Abhijeet Patil18-Jul-10 23:03
memberAbhijeet Patil18-Jul-10 23:03 
QuestionError: alloe definition= machine to application level Pin
muralekarthick15-Jul-10 0:13
membermuralekarthick15-Jul-10 0:13 
GeneralAccess through remote system Pin
shafaqat309_122-Jun-10 21:00
membershafaqat309_122-Jun-10 21:00 
Generaldotnet Error - Help to resolve Pin
veeruvvv12-Apr-10 21:56
memberveeruvvv12-Apr-10 21:56 
AnswerRe: How to fix this issue.. Pin
Abhijit Jana5-Dec-09 20:56
mvpAbhijit Jana5-Dec-09 20:56 
GeneralRe: Deployment works..but Pin
Abhijit Jana5-Dec-09 20:51
mvpAbhijit Jana5-Dec-09 20:51 
GeneralRe: Deployment works..but Pin
Abhijit Jana25-Nov-09 21:24
mvpAbhijit Jana25-Nov-09 21:24 
GeneralRe: Deployment works..but Pin
Abhijit Jana25-Nov-09 22:47
mvpAbhijit Jana25-Nov-09 22:47 
Member 402573918-Sep-09 11:44
memberMember 402573918-Sep-09 11:44 
GeneralQueries regarding Hosting Pin
Trupti Mehta10-Aug-09 4:38
memberTrupti Mehta10-Aug-09 4:38 
GeneralError from deployment on IIS 7 Pin
opunarcisse20-Jul-09 4:33
memberopunarcisse20-Jul-09 4:33 
GeneralRe: Error from deployment on IIS 7 Pin
Abhijit Jana22-Jul-09 0:44
mvpAbhijit Jana22-Jul-09 0:44 
GeneralRe: Error from deployment on IIS 7 Pin
opunarcisse29-Jul-09 9:41
memberopunarcisse29-Jul-09 9:41 
GeneralDeployment of ASP.NET website Pin
cwleecw19-Jul-09 22:42
membercwleecw19-Jul-09 22:42 

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
Web04 | 2.8.151125.3 | Last Updated 5 Sep 2008
Article Copyright 2008 by Abhijit Jana
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid