Mon, Nov 21 2005 10:37 PM
Erwyn van der Meer
Bug in defining browser definitions in ASP.NET 2.0
In my previous post about browser sniffing for Windows XP MCE in ASP.NET 2.0 I alluded to a bug I encountered when trying to override new browser capabilities in a .browser file. As I explained in more detail there you can define new browser definitions by just adding a .browser file to the App_Browsers directory of your web application.
All browser definition inherit from the default browser definition. You can add new capabilities to it like so:
<capability name="capability_1" value="1" />
But overriding its value like this:
<capability name="capability_1" value="2" />
<browser id="TestBrowser" parentID="Mozilla">
<userAgent match="TestBrowser" />
<capability name="capability_1" value="3" />
fails. Leaving out the default browser bit and just overriding the value set for the Mozilla browser works. I have submitted a bug in the MSDN Feedback Center for this issue (bug ID FDBK40924) with an attached sample web application and steps to reproduce it. The User Agent Switcher extension for Mozilla Firefox comes in very handy to test this. You can use this User-Agent string to match the TestBrowser definition:
Mozilla 4.0 (compatible; TestBrowser 1.0)
Please try to reproduce this bug on your system and vote for it in the MSDN Product Feedback Center. Otherwise it probably doesn't stand a chance of being fixed in the next service pack of the .NET Framework 2.0.
Filed under: .NET