Determine if IIS/ASP.NET recognises IE 11 browser version
<p>So when Microsoft bring out a new browser version, they need to run an update to the .NET Framework to make it recognise the browser version, otherwise certain functionality may be broke.  </p>

<p><a href="http://jwcooney.com/2013/11/19/asp-net-doesnt-detect-ie11/" rel="nofollow">ASP.NET Doesn’t Detect IE11</a></p>

<p>I am witnessing this - certain pages only work in compatibility view and they also work in Chrome too.  Then other pages will not work in compatibility view but they work in Edge mode when forced to by the browser.  We have the dreaded tag </p>

<pre><code>&lt;meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /&gt; 
</code></pre>

<p>in a master page which is our starter for 10, but not the question I am asking below.</p>

<p><strong>Question</strong></p>

<p>Question is, how do I get some conclusive proof on the server what it actually thinks the client browser is.  </p>

<p>Also, is there any information on how ASP.NET uses those .browser files - how can I determine how ASP.NET uses them to match the user agent, and what the other sections are.</p>

<p><strong>Background</strong></p>

<p>We have an old ASP.NET website project running under VS2013 and targeting .NET4.  I have VS2015 installed on the machine with .NET versions </p>

<p>I have checked <a href="http://smallestdotnet.com/?releaseKey=394271" rel="nofollow">smallestdotnet</a> to see which version I have.  It says 4.6.1 and gives my User Agent of:</p>

<pre><code>Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
</code></pre>

<p>When running in compatibility mode on the website it is:</p>

<pre><code>Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.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; MS-RTC EA 2)
</code></pre>

<p>Now our ASP_Browsers folder in the solution does not contain any browser definition files.</p>

<p>I have the following .browser files under the C:\Windows\Microsoft.NET\Framework folder:</p>

<pre><code>C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\avantgo.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\cassio.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\Default.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\docomo.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\ericsson.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\EZWap.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\gateway.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\generic.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\goAmerica.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\ie.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\Jataayu.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\jphone.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\legend.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\MME.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\mozilla.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\netscape.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\nokia.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\openwave.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\opera.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\palm.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\panasonic.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\pie.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\webtv.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\winwap.browser
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers\xiino.browser
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers\blackberry.browser
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers\chrome.browser
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers\Default.browser
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers\firefox.browser
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers\gateway.browser
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers\generic.browser
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers\ie.browser
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers\iemobile.browser
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers\iphone.browser
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers\opera.browser
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers\safari.browser
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers\ucbrowser.browser
</code></pre>

<p>The contents of v4.0.30319\Config\Browsers\ie.browser are as follows:</p>

<pre><code>&lt;browsers&gt;
    &lt;browser id="IE" parentID="Mozilla"&gt;
        &lt;identification&gt;
            &lt;userAgent match="MSIE (?'version'(?'major'\d+)(\.(?'minor'\d+)?)(?'letters'\w*))(?'extra'[^)]*)" /&gt;
            &lt;userAgent nonMatch="IEMobile" /&gt;
        &lt;/identification&gt;

        &lt;capture&gt;
            &lt;userAgent match="Trident/(?'layoutVersion'\d+)" /&gt;
        &lt;/capture&gt;

        &lt;capabilities&gt;
            &lt;capability name="browser"              value="IE" /&gt;
            &lt;capability name="layoutEngine"         value="Trident" /&gt;
            &lt;capability name="layoutEngineVersion"  value="${layoutVersion}" /&gt;
            &lt;capability name="extra"                value="${extra}" /&gt;
            &lt;capability name="isColor"              value="true" /&gt;
            &lt;capability name="letters"              value="${letters}" /&gt;
            &lt;capability name="majorversion"         value="${major}" /&gt;
            &lt;capability name="minorversion"         value="${minor}" /&gt;
            &lt;capability name="screenBitDepth"       value="8" /&gt;
            &lt;capability name="type"                 value="IE${major}" /&gt;
            &lt;capability name="version"              value="${version}" /&gt;
        &lt;/capabilities&gt;
    &lt;/browser&gt;

    &lt;!-- Mozilla/5.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4325) --&gt;
    &lt;browser id="IE6Plus" parentID="IE"&gt;
        &lt;identification&gt;
            &lt;capability name="majorversion" match="^[6-9]|\d{2,}$" /&gt;
        &lt;/identification&gt;

        &lt;capabilities&gt;
            &lt;capability name="jscriptversion"       value="5.6" /&gt;
            &lt;capability name="msdomversion"         value="${majorversion}.${minorversion}" /&gt;
            &lt;capability name="ExchangeOmaSupported" value="true" /&gt;
            &lt;capability name="activexcontrols"      value="true" /&gt;
            &lt;capability name="backgroundsounds"     value="true" /&gt;
            &lt;capability name="javaapplets"          value="true" /&gt;
            &lt;capability name="supportsVCard"        value="true" /&gt;
            &lt;capability name="supportsAccessKeyAttribute"    value="true" /&gt;
            &lt;capability name="vbscript"             value="true" /&gt;
        &lt;/capabilities&gt;
    &lt;/browser&gt;

    &lt;!-- Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;) --&gt;
    &lt;browser id="IE6to9" parentID="IE6Plus"&gt;
      &lt;identification&gt;
        &lt;capability name="majorversion" match="^[6-9]$" /&gt;
      &lt;/identification&gt;
    &lt;/browser&gt;

    &lt;!-- Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;) --&gt;
    &lt;browser id="IE7" parentID="IE6to9"&gt;
        &lt;identification&gt;
            &lt;capability name="majorversion" match="^7$" /&gt;
        &lt;/identification&gt;
        &lt;capabilities&gt;
            &lt;capability name="jscriptversion" value="5.7" /&gt;
        &lt;/capabilities&gt;
    &lt;/browser&gt;

    &lt;!-- Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729) --&gt;
    &lt;browser id="IE8" parentID="IE6to9"&gt;
        &lt;identification&gt;
            &lt;capability name="majorversion" match="^8$" /&gt;
        &lt;/identification&gt;
        &lt;capabilities&gt;
            &lt;capability name="jscriptversion" value="6.0" /&gt;
        &lt;/capabilities&gt;
    &lt;/browser&gt;

  &lt;!-- Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729) --&gt;
  &lt;browser id="IE9" parentID="IE6to9"&gt;
    &lt;identification&gt;
      &lt;capability name="majorversion" match="^9$" /&gt;
    &lt;/identification&gt;
    &lt;capabilities&gt;
      &lt;capability name="jscriptversion" value="6.0" /&gt;
    &lt;/capabilities&gt;
  &lt;/browser&gt;

  &lt;!-- Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) --&gt;
  &lt;browser id="IE10Plus" parentID="IE6Plus"&gt;
    &lt;identification&gt;
      &lt;capability name="majorversion" match="\d{2,}" /&gt;
    &lt;/identification&gt;
    &lt;capabilities&gt;
      &lt;capability name="jscriptversion" value="6.0" /&gt;
    &lt;/capabilities&gt;
  &lt;/browser&gt;

  &lt;browser id="InternetExplorer" parentID="Mozilla"&gt;
    &lt;identification&gt;
      &lt;userAgent match="Trident/(?'layoutVersion'[7-9]|0*[1-9]\d+)(\.\d+)?;(.*;)?\s*rv:(?'version'(?'major'\d+)(\.(?'minor'\d+)))" /&gt;
      &lt;userAgent nonMatch="IEMobile" /&gt;
      &lt;userAgent nonMatch="MSIE " /&gt;
    &lt;/identification&gt;

    &lt;capabilities&gt;
      &lt;capability name="browser"              value="InternetExplorer" /&gt;
      &lt;capability name="version"              value="${version}" /&gt;
      &lt;capability name="majorversion"         value="${major}" /&gt;
      &lt;capability name="minorversion"         value="${minor}" /&gt;
      &lt;capability name="layoutEngine"         value="Trident" /&gt;
      &lt;capability name="layoutEngineVersion"  value="${layoutVersion}" /&gt;
      &lt;capability name="type"                 value="InternetExplorer${major}" /&gt;
    &lt;/capabilities&gt;
  &lt;/browser&gt;

  &lt;gateway id="IEbeta" parentID="IE"&gt;
     &lt;identification&gt;
        &lt;capability name="letters" match="^([bB]|ab)" /&gt;
     &lt;/identification&gt;

     &lt;capture&gt;
     &lt;/capture&gt;

     &lt;capabilities&gt;
        &lt;capability name="beta"    value="true" /&gt;
     &lt;/capabilities&gt;
  &lt;/gateway&gt;

&lt;/browsers&gt;
</code></pre>

<p>Everything is running locally on my Windows 7 machine.  I am running:</p>

<pre><code>Windows 7 64-bit SP1.  
I have the website running in IIS 7.5.7600.16385.
IE11 (11.0.9600.18230)    
</code></pre>

<p>With Tracing enabled in the Web.Config, I get the following information of note:</p>

<p><strong>Headers Collection</strong></p>

<pre><code>User-Agent  Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
</code></pre>

<p><strong>Response Headers Collection</strong></p>

<pre><code>X-AspNet-Version    4.0.30319
SERVER_SOFTWARE Microsoft-IIS/7.5
</code></pre>