Updating IIS to .Net Framework 4.0

Use Visual Studio to open the Web project that was developed for the .NET Framework 2.0, the .NET Framework 3.0, or the .NET Framework 3.5, Visual Studio can automatically perform all the changes to Web.config files that are required to be able to run using .NET Framework version 4.0. If the project is a IIS project and you are using IIS 7.0, Visual Studio can also reassign the application to an application pool that is associated with the .NET Framework version 4.0.

If at all possible use Visual Studio to do the upgrade. If you do not then you will need to edit the Web.config file manually.

http://msdn.microsoft.com/en-us/library/dd483478.aspx