IIS 6.0 and ASP.NET, Part 1
Different Modes of Operation Available in IIS 6.0
IIS 6.0 has two modes of operation:
- Worker Process Isolation Mode—This is the native mode in IIS 6.0, in which all application code is run in an isolated environment, but without the performance penalty of previous IIS Versions. HTTP requests are routed through the kernel-mode driver (HTTP.SYS) to the correct application pool queue. User-mode processes that are serving an application pool directly pull the requests from HTTP.SYS and eliminate the unnecessary process hops encountered when having to send a request to an out-of-process DLL host and back again.
- IIS 5.0 Isolation Mode—This mode allows you to ensure compatibility for applications developed using IIS 5.0. In this mode, HTTP.SYS works similar to the Worker Process Isolation mode except that it routes requests only to a single request queue that is maintained by the WWW service. Then, depending on how the isolation is configured (in-process, out-of-process, or pooled), the request will be either processed in inetinfo.exe or dllhost.exe. In this mode, features such as application pooling, recycling, and health detection features are not available.
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.
Click here for a larger image.
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.
Configuring IIS 6.0 to Use the Correct Version of the ASP.NET
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.
Impact in ASP.NET Configuration Settings
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.
About the Author
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 email@example.com.
# # #
Page 3 of 3