IIS 7 on Windows 2008 R2 Standard

This occurred after installing some software. The same software enabled IIS 6 Management compatibility and other things, but the odd thing is what it did to .NET 4.0.

Our .NET apps are all 4.0 on this server, but check this error message:

enter image description here

Since it looks like it's the 2.0 compiler throwing the error, the first thing we did was check to see if the .NET version for the web application (and the website as a whole) had changed. And we got this screen.

enter image description here

Note that ASP.NET 4.0 is selected, but the Properties textbox below indicates 2.0.

Is there a simple fix for this? We could restore the server from a backup, but that's a bit messy. I'm just wondering if this is a known issue, and if anyone knows the fix.


Normally in the application pool settings (for the actual application pool, not the site) you can change the .net framework version.

If the application would prefer .net 2.0, you should move it to a different application pool. I'd also consider contacting the vendor to get them to fix their installer, if you're sure it did it.


This issue can occur if the project has a referenced assembly that requires the 2.0 CLR.

The process for CLR selection is a bit complex. It's actually possible to run multiple versions of the CLR side-by-side in the same process.

If you don't need ASP.NET 2.0, you can remove it with the following command(s):

%systemroot%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -u  
%systemroot%\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -u  

You should also ensure that the ASP.NET 4 for the appropriate platform is installed. I.e., if the application is 32-bit, the 32-bit ASP.NET aspnet_regiis.exe should be installed.

You may also want to include the following in your web.config. Note that it should specify "v4.0" and not "v4.0.30319".

    <supportedRuntime version="v4.0" />

Determining Which Version of the Runtime to Load

  • Thank you. @Falcon Momot's answer actually fixed us, so I didn't even have a chance to try your suggestions, but I do appreciate the effort. – David Stratton Aug 15 '12 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.