Fix for Internet Explorer 11 and ASP.NET 4.0

Date: December 27, 2013
Author: Chris Lee

If you run ASP.NET 4.0 on Windows Server 2003, you will have problems with both Internet Explorer 10 and Internet Explorer 11. This is because ASP.NET fails to detect those versions of Internet Explorer. Yeah, I know.

Here's what's happening:

IIS 6 serves an .aspx page to a user with IE 11.

IIS 6 asks ASP.NET 4.0 to render the page

ASP.NET 4.0 looks into its ie.browser files, but it cannot recognize IE 11.

So instead of detecting IE11 and optomizing the web page for that browser, ASP.NET 4 treats it as an unknown browser and serves up a crappy, broken page.

There are many fixes for this posted all around the internet. None of them have worked for us. The only fix that I've found to to work with this setup is one:

The fix

Download these ASP.NET browser definition files and install into your web application's /App_Browsers/ directory. If you don't have an /App_Browsers/ directory, then create one and place it in the root directory of your site.

Search for __browserCapabilitiesCompiler.compiled under "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files" and delete all instances of those files.

Open a command prompt in C:\Windows\Microsoft.NET\Framework\v4.0.30319

Run aspnet_regbrowsers.exe -i

Restart IIS by running "IISRESET" at the run command

This should solve the problem.

If you are running a newer version of IIS, then the process is easier:

If you are running Windows Server 2012: Simply make sure you have installed all Windows updates for .NET 4.5

If you are running Windows Server 2008 or 2008R2:
Install .NET 4.5 or .NET 4.5.1 with all of Windows updates.

If you run ASP.NET 4.0 on Windows Server 2003, you will have problems with both Internet Explorer 10 and Internet Explorer 11. This is because ASP.NET fails to detect those versions of Internet Explorer.