Datasheet

Starting Up an Application Domain
All managed code in the .NET Framework needs to run within an application domain. Before ASP.NET
can start the HTTP pipeline and run a page, the ISAPI extension must ensure that an application domain
has been instantiated and initialized. In ASP.NET, each application, as configured in the IIS MMC, maps
to a separate application domain in the managed world. Figure 1-6 shows a web server with a default
website, and one IIS application configured beneath the root of the default website.
Figure 1-6
The ASP.NET ISAPI extension will ensure that an application domain is created for ASP.NET during the
first request for a page in the default website. If another request were received for a page within the web
application called
inproc, aspnet_isapi.dll would create a second application domain because inproc
is configured as a separate application. Overall, this means that within a single IIS6 worker process, any
number of configured IIS applications, and thus independent application domains, can be running. It is the
responsibility of the ISAPI extension to route each incoming HTTP request to the appropriate application
domain. Isolating the different applications into separate application domains gives ASP.NET the flexibility
to perform some of the following tasks:
❑ Maintain separate security configurations for each application domain
❑ Enforce different trust level restrictions in each application domain
❑ Monitor and if necessary recycle application domains without affecting other application
domains
Starting up an application domain involves several processing steps. After a new application domain
has been created, the ISAPI extension carries out the following steps, listed in order of their occurrence:
1. Establish the identity for application domain initialization.
2. Verify directory access/existence and initializing directory information.
3. Set the trust level for the application domain.
4. Set the locations of assemblies.
5. Obtain the auto-generated machine key.
6. Initialize the ASP.NET compilation system.
15
Initial Phases of a Web Request
04_596985 ch01.qxp 12/14/05 7:46 PM Page 15