Error: Cannot read configuration file because it exceeds the maximum file size

Default maximum file size for web.config file is 250KB. If the size of the web.config file exceeds 250 KB, web site throws an error. Microsoft added this file size restriction to prevent attacker from uploading large config file to the server and start a possible Denial of Service (DOS) attack.

Microsoft provided a Registry key for changing this size limit. You can change the following registry key to increase the size.


If you are using 64 bit OS you might have to set the registry key in the following location.


If the key doesn’t exist, you have to create one. After creating the key you need to reset IIS before you can see the effect of the new value.

Add a Comment

Your email address will not be published. Required fields are marked *