Thursday, May 29, 2014

Incorrect User Agent String for Internet Explorer 11 using .NET v. 4.0

I frequently use Server-Side Browser Detection to enforce rules regarding browser compatibility to prevent people from using non-supported browsers with my application (especially older versions of Internet Explorer).

I was recently testing my Browser Detection library using Internet Explorer 11 and .NET v. 4.0.  Internet Explorer 11 is relatively new to the Windows 7/Windows Server 2008 R2 platform and ONLY ships with Windows 8.1 and Windows Server 2012 R2 so I really had not done much testing with it in the past.

Interestingly enough, I discovered that the browser information for Internet Explorer emulated Mozilla for the .NET v. 4.0 platform!!

Below is a screenshot of the results from running my test application in Internet Explorer 11:

Even more interesting is that this appears to be ONLY a problem with Internet Explorer 11 since Internet Explorer 10 is detected just fine.

As you can probably guess, this issue is already well known and even has a Connect feedback item here:

This article describes a fix for this issue that does not require changing the version of the application, but rather simply installing .NET v. 4.5 on the target server:

After downloading and installing .NET Framework v. 4.5.1 from this link here:, I was able to successfully detect Internet Explorer 11 correctly!

No comments:

Post a Comment