Upgrading to .NET 4 on an IIS site supporting a .NET 2.0 child application

Today I decided to finally make progress on a couple pending applications. As part of that process I needed to upgrade one of my sites to .NET 4. Unfortunately it has a child application that needs to say as .NET 2.0/3.5. After approximately 30 minutes of downtime, I finally got things configured correctly (seemingly). Here's what I ended up having to do.

This assumes IIS 7.5.

  1. Wrap the system.web and system.webServer elements in the parent Web.config with the following:
    <location path="." inheritInChildApplications="false" allowOverride="true">
    ...
    </location>
  2. If you have the following set in system.webServer, you'll want to move that outside of the location wrapper you added in step 1. Otherwise the site doesn't appear to capture that, and you'll 500.
    <validation validateIntegratedModeConfiguration="false"/>
  3. Change the application pool settings on the parent application to .NET Framework 4.0 and push the above change.

That was the only change it appears I needed to make. Instead I made a number of minor changes, all over the place, which resulted in the downtime.

In my particular case I also had both the parent and child applications running on the same application pool. I ended up creating a new application pool for the child application, switched it over to that, but neglected to set the identity as NETWORK SERVICE, which resulted in a few moments of questioning. Actually, I correctly set this to the application pool identity, but had actually neglected to give the correct directories the new permissions (since I changed the applicaton pool).

Needless to say, I'll be very happy when I re-write the child application over to .NET 4.