X-UA-Compatible, Web.config, and Visual Studio 2005

  • Thread starter Thread starter Nathan Sokalski
  • Start date Start date
N

Nathan Sokalski

On Microsoft's page about IE8 and Defining Document Compatibility at:

http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx

They give the following code to add to Web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=EmulateIE7">
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>

When I tried to add this code using Visual Studio 2005, IntelliSense did not
seem to include the <httpProtocol> tag as part of the schema. I was able to
type it in completely by hand, which since it is such a small section is not
a problem (I'm not lazy, this is just a question out of curiosity and
attempt to make something work correctly). I'm assuming it will work
correctly whether IntelliSense helped me or not, since Visual Studio did not
give me any errors. Why is IntelliSense not letting me know about the
<httpProtocol> tag? Thanks.

NOTE: I don't know if anybody else noticed (and obviously Microsoft didn't,
since it still isn't fixed on the page I mentioned), but the line:
<add name="X-UA-Compatible" value="IE=EmulateIE7">
Is missing the self-closing slash and should be:
<add name="X-UA-Compatible" value="IE=EmulateIE7" />
Since XML is strict about this, I just wanted to point it out.
 
On Microsoft's page about IE8 and Defining Document Compatibility at:

http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx

They give the following code to add to Web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <httpProtocol>
      <customHeaders>
        <clear />
        <add name="X-UA-Compatible" value="IE=EmulateIE7">
      </customHeaders>
    </httpProtocol>
  </system.webServer>
</configuration>

When I tried to add this code using Visual Studio 2005, IntelliSense did not
seem to include the <httpProtocol> tag as part of the schema. I was able to
type it in completely by hand, which since it is such a small section is not
a problem (I'm not lazy, this is just a question out of curiosity and
attempt to make something work correctly). I'm assuming it will work
correctly whether IntelliSense helped me or not, since Visual Studio did not
give me any errors. Why is IntelliSense not letting me know about the
<httpProtocol> tag? Thanks.

NOTE: I don't know if anybody else noticed (and obviously Microsoft didn't,
since it still isn't fixed on the page I mentioned), but the line:
<add name="X-UA-Compatible" value="IE=EmulateIE7">
Is missing the self-closing slash and should be:
<add name="X-UA-Compatible" value="IE=EmulateIE7" />
Since XML is strict about this, I just wanted to point it out.

ASP.NET is not mentioned in the article, I think it might be about
root web.config from \win\microsoft .net\framework\version\config

The httpProtocol element is for IIS 7.0 and it didn't included in the
schema for .NET 2.0. In VS.NET 2008 I have to create a .NET 3.5
application to make the IntelliSense working with that element.
 
Back
Top