views:

288

answers:

2

The BrowserCaps setting is rather quite long. Is there a way to factor it into an external config file.

does anyone know the markup?

A: 

It's just XML, and an updated version of the BrowserCaps file can be found here (props to this previous answer for pointing me in that direction):

Browser Detective and BrowserCaps Resources

If you're using ASP.NET 2.0+ then as the browserCaps element is depricated as of .NET 2.0, you should look into using .browser files in an /App_Browsers folder.

Zhaph - Ben Duguid
This doesn't really answer the original question of how to externalize the BrowserCaps web.config key into a separate file. I too am also having this problem since adding in the latest browser caps .xml into the application's web.config exceeds the default max web.config size limit. Adding the registry key to change the default max isn't working for me for some reason (Vista/IIS 7), even after recycling the IIS process and rebooting.
abraginsky
Registry key link: http://blogs.iis.net/ksingla/archive/2007/12/30/list-of-registry-keys-affecting-iis7-behavior.aspx
abraginsky
+1  A: 
  1. Create a new web.config file in your project and call it browserCaps.config

  2. Paste the XML of the latest browserCaps (http://owenbrady.net/browsercaps/CodeProject.xml) into this new file.

  3. In the existing web.config file of your project, add the following key within the <system.web></system.web> section:

    <browserCaps configSource="browserCaps.config"/>

Also see this link: http://weblogs.asp.net/fmarguerie/archive/2007/04/26/using-configsource-to-split-configuration-files.aspx

abraginsky
The question doesn't explicitly state which version of ASP.NET they are using, and as the current version of ASP.NET has BrowserCaps depricated I felt it was better to point them in the direction of a better solution to their problem. If they are running ASP.NET 1.1, then the configSource option won't work either: http://msdn.microsoft.com/en-us/library/sk9az15a.aspx
Zhaph - Ben Duguid
You make a good point.
abraginsky