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.

Prashant Wednesday, August 3, 2005
whats is te difference between IIS session timeout and Sessionstate timeout in web.config?

scott Wednesday, August 3, 2005
The session timeout in IIS is for ASP scripts.


Use web.config for ASP.NET session timeouts.
Anand Monday, January 16, 2006
That was really great.
I would like to ask one question here.
I have one application which runs fine with server 2003, but failes with XP. The application tries to open command prompt (cmd.exe).
What all rights do i need to give in order to make it run in the same way as it does with XP?
scott Wednesday, March 8, 2006
Anand: Just found this comment. Do you want to open the command prompt so it appears on the desktop? That just won't be possible on a server.
Koob Wednesday, November 29, 2006
There is one other small thing: When you let handle files like .css, f.i. when you want to load them from a database, you have to change your configuration: IIS6 does not ask for these filetypes for optimization reasons. You have to explicitly add them to the web.config, to force ISS6 ask what to do with these files.
This is important when you use a VirtualPathProvider for these file types.
Comments are closed.

My Pluralsight Courses

K.Scott Allen OdeToCode by K. Scott Allen
What JavaScript Developers Should Know About ECMAScript 2015
The Podcast!