http://www.developer.com/net/csharp/article.php/2243151/IIS-60-and-ASPNET-Part-1.htm
IIS 6.0 is the next generation of Web server available in the Windows Server 2003 platform. IIS 6.0 provides several enhancements over IIS 5.0 that are mainly intended to increase reliability, manageability, scalability, and security. IIS 6.0 is a key component of the Windows Server 2003 application platform, using which you can develop and deploy high performance ASP.NET Web applications, and XML Web Services. In this series of articles, we will take a look at the new features of IIS 6.0 such as new scalable HTTP request processing architecture, the ability to store IIS configuration settings in XML file, improved reliability by means of application pools, and so on. We will also demonstrate how to create effective ASP.NET Web applications that can leverage the features of IIS 6.0. Along the way, we will also illustrate the changes in the security model of IIS 6.0 and how they affect your ASP.NET applications. In Part 1 of this article, we will look at the steps to follow to install IIS 6.0 and then understand how to host ASP.NET applications in IIS 6.0. We will also review the different isolation modes of IIS 6.0 and how they impact ASP.NET applications. A new generation of Web applications puts a greater demand on performance and scalability attributes of Web servers. For example, the Web server is expected to increase the speed at which HTTP requests are processed, but still allowing more applications and sites to run on one server. This also means that very few servers are needed to host a site, allowing the existing hardware investments to sustain longer while being able to handle greater capacity. Another important aspect of the Web server is its reliability. IIS 6.0 has been designed from the ground up to allow us to create reliable applications. For example, in IIS 6.0, you can isolate each application or Web site to run in its own process space. By doing this, you can ensure that applications are isolated and problems in one site do not affect the rest of the applications on the same server. Before we take a look at IIS 6.0's architecture, let us take a moment to understand the IIS 5.0 architecture. In IIS 5.0, there was only one main process, represented by the executable inetinfo.exe, that was designed to function as the main Web server process, which could route requests to one or more out-of-process applications that are running within the dllhost.exe. With this architecture, Inetinfo.exe is the master process through which each request must traverse regardless of isolation mode. IIS 5.0 had three isolation modes: In-Process, Out-of-process, and Pooled. In the In-Process mode, all the applications run in the same process as that of the Web server (inetinfo.exe). The IIS 5.0 default mode is Pooled, in which the Web server (Inetinfo.exe) runs in its own process and all other applications will run in one single-pooled process (dllhost.exe). You can set high-priority applications to run as Isolated, which creates another instance of dllhost.exe. Even though this out-of-process isolation allows you to increase the fault-tolerance of your Web server, it is slow in terms of performance. The Pooled mode is the best performance/isolation tradeoff, but there is only one pool on a server and all pooled applications must use the same pool. In this section, we will look at the architecture of IIS 6.0 to understand the compelling features provided by IIS 6.0 that contribute to the increase in scalability, reliability, and manageability. IIS 6.0 has been totally re-designed with a new request processing architecture that has the benefits of high isolation without incurring the out-of-process cost, as well as much higher levels of reliability and scalability. You can split the main components of IIS 6.0 into the following two broad categories. The IIS 6.0 request processing architecture explained in the previous section delivers very high levels of reliability without sacrificing performance. Especially, In the following section, we will illustrate the procedures for installing IIS in your Windows 2003 Server. Once you install Windows server 2003, by default, only the necessary components of the operating system will be installed, meaning that you need to explicitly install the required components such as IIS 6.0. You can install IIS 6.0 using either one of the following two options: Now that you have installed IIS 6.0, let us go ahead and create a new ASP.NET application using Visual Studio.NET 2003. Open up Visual Studio.NET 2003, and select the File->New Project dialog box and specify information as shown in the following screenshot. Once you click OK on the above screen, you will see the following message box that says ASP.NET applications are locked down in IIS. In the case of IIS 5.0, once you install IIS, it is ready to serve up all static (such as HTML pages) as well as dynamic content (such as ASP pages). But now in IIS 6.0, installation alone is not enough. You need to explicitly configure IIS to allow specific types of applications such as ASP, ASP.NET, CGI, ISAPI, and so on to be created on the server. To enable ASP.NET Web applications, you need to use the new feature called Web Service Extensions in IIS Manager, which we will look at in the following section. But, when you install IIS 6.0, it is installed in a highly secure and locked mode, meaning that IIS serves only static content, and dynamic content such as ASP, ASP.NET, and so on are not enabled. To enable dynamic content, you need to use what is known as Web Service Extensions and modify the settings in IIS Manager. A Web Service Extension is nothing but a specific type of handler that is used to handle requests for a specific type of dynamic content. For example, requests for ASP.NET pages are processed by a handler, ASPNET_ISAPI.dll. If you want to allow ASP.NET pages to be served up from your Web server, you need to explicitly allow this handler, using the Web Services Extension from IIS. Using the Web Service Extensions feature that is accessible through the IIS manager, Web site administrators can enable or disable IIS 6.0 functionality based on the individual needs of the organization. This functionality is globally enforced across the entire server. Apart from the graphical interface, IIS 6.0 also provides programmatic, command-line, and graphical interfaces for enabling Web service extensions. To enable Web service extensions, select Web Service Extensions node from the IIS Manager. This will result in all the Web service extensions being displayed in the listview on the right side of the screen. To enable a specific Web service extension, select the Web service extension, right-click it and select Allow from the context menu. Once you enable the Web service extension, the value of the Status column in the listview changes to Allowed from Prohibited. Because we want to allow ASP.NET applications on the server, select the Web Service Extensions ASP.NET v1.1.4322 from the list, and right-click it to select Allow from the context menu. This is illustrated in the above screenshot. When you upgrade your ASP applications to run in IIS 6.0, you may need to evaluate what Web service extensions need to be enabled. Enabling all of the Web service extensions ensures the highest possible compatibility with your existing ASP and ASP.NET applications. However, enabling all of the Web service extensions creates a security risk because it increases the attack surface of IIS by enabling functionality that might be unnecessary for your server. When you right-click the Web Service Extensions node in the IIS manager, the context menu displays a number of options that allow you to perform this. This is shown in the following screenshot. Now that you have enabled ASP.NET Web Service Extensions from IIS Manager, if you go back to Visual Studio.NET and create the ASP.NET Web Application project again, you will find that the project is created properly. IIS 6.0 has two modes of operation: To configure the appropriate IIS operation mode for your Web server, right-click the Web Sites folder from the treeview and select Properties from the context menu. Then, navigate to the Service tab in the Properties dialog box. In this window, you can modify the mode by selecting the checkbox that is right next to the Run WWW service in IIS 5.0 isolation mode option. This is illustrated in the following screenshot. Once you select this option, the Applications Pools node in the IIS manager treeview will no longer be available because you can't configure application pools when running your server in IIS 5.0 isolation mode. In the next section, we will see how these different modes of isolation impact the version of the .NET Framework that is used to service all the applications running on that particular server. When migrating your existing ASP.NET applications to run in IIS 6.0, you may need to install the .NET Framework version 1.0 on the target server to ensure that the applications continue to function properly. As you might recall, by default, when you install IIS 6.0, it also installs .NET Framework, version 1.1. After you manually install version 1.0 of the .NET Framework, both version 1.0 and 1.1 of the .NET Framework are available on the target server. This is referred to as side-by-side installation. Even after installing the .NET Framework version 1.0, you will find all the ASP.NET applications running on the server still use version 1.1 of the .NET Framework. If you want your ASP.NET applications to use the .NET Framework version 1.0, you need to run IIS in IIS 5.0 isolation mode because, by default, IIS 6.0 runs in Worker Process Isolation mode. This means that your ASP.NET applications can only use version 1.1 of the .NET Framework. In most cases, your existing ASP.NET applications will function correctly with version 1.1 of the .NET Framework. When your ASP.NET application is incompatible with version 1.1 of the .NET Framework, configure the application to use version 1.0 of the .NET Framework. To accomplish this, you need to run IIS in IIS 5.0 isolation mode. It also is possible for you to configure each ASP.NET application to use a specific version of the .NET Framework by registering a script map in IIS for the application. A script map associates a file name extension and an HTTP verb with the appropriate ISAPI for script handling. For example, when IIS receives a request for an .aspx file, the script map for the corresponding application directs IIS to forward the requested file to the appropriate version of the ASP.NET ISAPI for processing. The script map for each ASP.NET application can be applied directly to an application, or inherited from a parent application. However, ASP.NET supports only one version of the .NET Framework for each application pool. The configuration method for ASP.NET is determined by the application isolation mode that you use to configure IIS 6.0. When you run IIS in Worker Process Isolation mode, you must use the IIS Manager to make changes to the ASP.NET configuration settings. If you are running your IIS in IIS 5.0 Isolation mode, you must use machine.config to make changes to the ASP.NET configuration settings. When IIS 6.0 is configured to run in IIS 5.0 isolation mode, the .NET Framework uses the <processModel< section of the machine.config file (in the <Drive Name>:\systemroot\Microsoft.NET\Framework\versionNumber\Config folder) for its configuration and no additional steps are required. However, when IIS 6.0 is configured to run in worker process isolation mode, the .NET Framework ignores the <processModel> section of the machine.config file, and instead gets its process configuration from the IIS 6.0 Metabase. In Part 1 of this article series, we have understood the new request processing architecture of IIS 6.0. We also illustrated the steps for installing IIS, and then how to enable ASP.NET applications using the Web Service Extensions. We also demonstrated how to configure IIS to use the appropriate version of the .NET Framework. In Part 2 of this series, we will see how to leverage application pools to increase the reliability of ASP.NET Web applications. Thiru has six years of experience in architecting, designing, developing and implementing applications using Object Oriented Application development methodologies. He also possesses a thorough understanding of software life cycle (design, development and testing). He is an expert with ASP.NET, .NET Framework, Visual C#.NET, Visual Basic.NET, ADO.NET, XML Web Services and .NET Remoting and holds MCAD for .NET, MCSD and MCP certifications. Thiru has authored numerous books and articles. He can be reached at thiruthangarathinam@yahoo.com. # # #
IIS 6.0 and ASP.NET, Part 1
July 31, 2003
Introduction
IIS 6.0 Architecture

Benefits of the IIS 6.0 Request Processing Architecture
Installing IIS 6.0
Creating a new ASP.NET Web Application in IIS 6.0

Click here for a larger image.

Click here for a larger image.
Enabling ASP.NET Applications in IIS

Click here for a larger image.

Click here for a larger image.
Different Modes of Operation Available in IIS 6.0

Click here for a larger image.
Configuring IIS 6.0 to Use the Correct Version of the ASP.NET
Impact in ASP.NET Configuration Settings
Conclusion
About the Author