OdeToCode IC Logo

Moving ASP.NET Apps from IIS 5.x to 6.0

Sunday, July 10, 2005

Here are areas to watch when moving an ASP.NET app from Windows 2000 / XP ( IIS 5.x) to Windows Server 2003 (IIS 6.0). These notes assume you do not configure IIS 6.0 to use IIS 5.0 isolation mode

- Worker Process Changes

Web applications execute inside a worker process to isolate themselves from IIS. The isolation allows IIS to continue running and servicing requests even when your web application is going down in flames. In IIS 5.x the worker process name is aspnet_wp.exe, and the process runs under the ASPNET account. The ASPNET account is a local machine account and has no network access. The best the ASPNET account can do is appear as an anonymous user to a remote machine.

In IIS 6.0, the worker process is w3wp.exe. The process runs under the NETWORK SERVICE account. The NETWORK SERVICE account has access to the machine credentials for outbound connections, and will appear to a remote machine as [DomainName]\[ComputerName]$.

What this means.

When granting permissions to local resources, make sure to pick the correct account. On Windows 2003, the .NET installation will still create the ASPNET account event though the worker process runs as NETWORK SERVICE by default. If you need access to remote resources, like when making a trusted connection to a database, you can grant access to the web server’s machine account if the worker process runs as NETWORK SERVICE.

<processModel> Changes

Under IIS 5.0, the <processModel> section in machine.config controls many of the settings for the worker process (aspnet_wp.exe). Under IIS 6.0, only the following <processModel> settings are used: maxWorkerThreads, maxIoThreads, and responseDeadlockInterval. All other settings, such as idleTimeout are now configured using the IIS 6.0 metabase.

What this means

Except for the three settings above, use the Application Pool settings in the IIS management console to adjust settings for the worker process. This includes changing the identity for the worker process. You’ll need to right click and select the Properties option for the Application Pool your code runs in. You can find out which pool to use by inspecting the “Application settings” under the directory properties tab where your application lives.

ASP.NET is off by default in Windows Server 2003

Most non-critical services are off by default in Server 2003. If you see 404 errors requesting ASPX forms, or the forms display server side markup instead of dynamic content, you need to enable ASP.NET.

What this means.

Use Manage Your Server to enable ASP.NET.

Process Recycling

The default <processModel> setting for the idleTimeout property is Infinite. Once the application has been inactive for an idleTimeout amount of time, the worker process will shut down (never, if idleTimeout is infinite). Remember though, on IIS 6.0 the metabase overrides the <processModel> settings, and the default timeout is 20 minutes. If applications in the pool receive no requests for 20 minutes, the worker process terminates. In-process Session state and Cache are emptied, and connections are closed.

What this means.

If a worker process has to start from scratch, there is quite a bit of work to do. The cache will be empty, the connection pool will be empty, and your web application code needs JIT compiled. All the work means you could see a sluggish response to the one request that starts the application running again. If you have a dedicated server for your application, consider disabling the idle timeout. Also note: if you’ve configured session timeout to be longer than the idle process timeout, then sessions will appear to timeout prematurely.