Cannot Read Configuration File Because it Exceeds the Maximum File Size
Asked Answered
A

1

7

Cannot read configuration file because it exceeds the maximum file size.

I'm getting above error because my rewritemap.config file size is more than 250KB (Windows 2008 R2 SP1 server with IIS 7.5

Anew answered 4/3, 2014 at 10:19 Comment(0)
D
15

If you have access to registry and if you really need file greater than 250kb, you can change value in Registry Key.

For an x32 system:

Create the Key:

HKLM\Software\Microsoft\InetStp\Configuration\

Add the DWORD value:

MaxWebConfigFileSizeInKB

For an x64 system:

Create the Key:

HKLM\Software\Wow6432Node\Microsoft\InetStp\Configuration\

Add the DWORD Value:

MaxWebConfigFileSizeInKB

Be sure to reboot or restart the application pool. This answer to a related question may also inspire.

Note: If there are not the key, you can just create it. how to create a key on regedit

Other alternative is to split the .config files. http://forums.asp.net/t/1961321.aspx?Split+web+config+rewrite+rules+in+separate+file

Dincolo answered 16/3, 2014 at 23:53 Comment(4)
It doesn't help to me in local enviroment. On server it works. IIS 10Eisenberg
HKLM stands for HKEY_LOCAL_MACHINE in the Registry Editor. I'm not sure if there is a reason it's abbreviated, but maybe the post should be edited to reflect what it shows in the editorBradbradan
worked for me once I changed values to "MaxWebConfigFileSizeInKB "=dword:00000800 Which is strangeBourse
I got this error after installing a SP2013 CU for Jan 2023. The CU made the web.config size greater than 250KB. Setting both the x64 and x32 system registries mentioned above and restarting the server fixed the issue for me. Though restarting IIS or app pool got the app working again, any MMC consoles or PowerShell consoles that weren't aware of the registry change needed to be restarted too.Micheal

© 2022 - 2024 — McMap. All rights reserved.