Eric Andres
Eric Andres

Reputation: 3417

Internet explorer sending different user-agent strings to different sites

I'm trying to track down a bug right now with a silverlight application. We are getting the browser info from the HtmlPage.BrowserInformation class, but it seems to be returning incorrect information. When running on IE9, the browser information says that it is running on version 8.0. I opened up Fiddler to see what was happening at the HTTP level, and here is what I'm getting for the user-agent strings to my test servers (the test servers run our own server software that uses WCF for HTTP requests):

User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E)

Here's the user-agent string when I go to any other site:

User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)

I'm not sure how the BrowserInformation class works (i.e., does all of its information come from the user-agent string, or from somewhere else). Any insights on this would be helpful.

Upvotes: 4

Views: 1395

Answers (1)

Registered User
Registered User

Reputation: 3699

From your question it is clear that you are not a IE user.

Tho resolve your issue you need to add this to all the pages:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

It is important to add it right after the head tag like this:

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

Upvotes: 4

Related Questions