4
votes

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.

1
Silly question, is the browser set to run in compatability mode on that site?EtherDragon
I've looked, and it appears that it isn't, but I don't know of a fool proof way to tell. Right now I'm pulling up the command bar, then going to the tools menu, then looking at the Compatibility View item, but it's grayed out.Eric Andres

1 Answers

4
votes

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" />