It turns out, microsoft has a size limit of 250KB on the web.config file of a web site by default.
I ran into this problem because a test website I maintain has a lot of things in its config file, and so the size went past the above threshold.
The workaround is this:
References:
I ran into this problem because a test website I maintain has a lot of things in its config file, and so the size went past the above threshold.
The workaround is this:
- If you create a DWORD MaxWebConfigFileSizeInKB under HKLM\SOFTWARE\Microsoft\InetStp\Configuration\ and set it to the number of kilobytes that the new max size limit must be, that will override the 250kb limit.
- The registry key for IIS 7 / 7.5 running under 32 bit windows is HKLM\SOFTWARE\Wow6432Node\Microsoft\InetStp\Configuration\MaxWebConfigFileSizeInKB
- HKLM/HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\IISExpress\10.0\mimic\Configuration\MaxWebConfigFileSizeInKB
References:
- https://blogs.msdn.microsoft.com/httpcontext/2012/10/23/cannot-read-configuration-file-because-it-exceeds-the-maximum-file-size-web-config/
- https://support.microsoft.com/en-us/help/954864/description-of-the-registry-keys-that-are-used-by-iis-7.0,-iis-7.5,-and-iis-8.0
- http://stackoverflow.com/questions/37111764/change-maximum-allowed-configuration-file-size-iis-express-10-windows-10
- https://blogs.msdn.microsoft.com/amb/2013/01/07/iis-express-8-and-large-web-config-files-cannot-read-configuration-file-because-it-exceeds-the-maximum-file-size-error-message/