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?

TimLeung
  • 3,459
  • 6
  • 42
  • 59

2 Answers2

4
  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

Ari Braginsky
  • 928
  • 1
  • 11
  • 21
  • 1
    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 Aug 26 '09 at 08:03
0

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 deprecated as of .NET 2.0, you should look into using .browser files in an /App_Browsers folder.

Community
  • 1
  • 1
Zhaph - Ben Duguid
  • 26,785
  • 5
  • 80
  • 117
  • 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. – Ari Braginsky Aug 25 '09 at 21:18
  • Registry key link: http://blogs.iis.net/ksingla/archive/2007/12/30/list-of-registry-keys-affecting-iis7-behavior.aspx – Ari Braginsky Aug 25 '09 at 21:19