Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the maximum size of Web.config?

When I tried to open my SharePoint extended site, I received error 500. The error message was:

Cannot read configuration file because it exceeds the maximum file size

My web.config file was just about 260 KB, because it had so many <SafeControl> entries in it. After removing some of the old entries, and getting the file down to 186 KB, my site started to load correctly.

My question:

  • What is the maximum size of web.config?
  • What can be done to avoid such problems in the future?
like image 725
Tschareck Avatar asked Jun 29 '12 09:06

Tschareck


1 Answers

Its not hard coded its defined in

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\Configuration\MaxWebConfigFileSizeInKB

or on 64 Bit machines

HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\InetStp\Configuration\MaxWebConfigFileSizeInKB

The "cutoff point" by default, unless you configure the MaxWebConfigFileSizeInKB appears to be 250Kb

Remember you can always split your web.config files into multiple little files to get around this issue,

like image 200
John Mitchell Avatar answered Oct 03 '22 05:10

John Mitchell