What does the ".NET Framework Version" setting in IIS actually do?

This seems like an obvious question, but I'm trying to determine what the "Change .NET Framework Version" button on the top level IIS configuration panel actually changes. On all of my servers, it has always been left at v2.0. My application pools are a mixture of v2.0 and v4.0 and all of my v4.0 applications operate correctly.

So, what does this version number control? What would rely on this that wouldn't be assigned to an application pool? Seems strange.

The setting in question is pictured below:

enter image description here


Solution 1:

It makes IIS point to different root level config files for .NET. These root level files reside within the framework installation folders in %systemroot%\Microsoft.NET\Framework\<version>\CONFIG

IIS looks for config files for itself in %systemroot%\system32\inetsrv\config\applicationHost.config
and for .NET in
%systemroot%\Microsoft.NET\Framework\<version>\CONFIG\machine.config

Changing the .NET Version switches which machine.config get used. For example, changing it to v2.050727 will have it look at %systemroot%\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config. Changing to v4.0.30319 will have it look at %systemroot%\Microsoft.NET\Framework\v4.0.30319\CONFIG\machine.config

Applications inherit things from the root level config settings.

Have a look at this article that outlines the config system and shows the configuration hierarchy.

Solution 2:

According to TechNet, this setting controls the "Default" .NET Framework version.

At the application pool level, this setting controls the framework that is used to host applications associated with the pool. At the server level, this setting doesn't appear to have any immediate or obvious affect on .NET 4.0 or 2.0 sites running on my test server, however I doubt it would be an option if it did nothing. It's location in the Deploy section of the Actions pane makes me wonder if it would affect the import/export packages located there as well. I'm going to test this.

I found a related thread on iis.net which seems to indicate this setting would affect the configuration file sections that are supported by default without adding to the top of files.

I haven't found much else searching the web, it seems to be a pretty obscure setting.

Edit: The answer from squillman is better.