IIS Express 8 and large web.config files – "cannot read configuration file because it exceeds the maximum file size" error message


Consider the following scenario:

You are running IIS Express 8 to test your web application and your web application contains a web.config file which is larger than 250 KB. When you run your application under IIS Express 8, you are receiving “Cannot read configuration file because it exceeds the maximum file size” error message as seen in the following screenshot:

As explained in http://support.microsoft.com/kb/954864, the maximum size of a web.config file is 250 KB but you can increase the value by adding MaxWebConfigFileSizeInKB key under Microsoft\InetStp\Configuration registry key and increase the limit (or set 0 for unlimited size). However, IIS Express 8 does NOT honor this registry setting.

Instead, if you are running IIS Express 8, you need to create MaxWebConfigFileSizeInKB under the following keys when you are using large web.config files:

For 32bit processes:



For 64bit processes:



You need to restart IIS Express 8 for the changes to take effect.

(Note that you may need to create Configuration registry key as well.)


My colleauge, Benjamin Perkins, has posted a great article about IIS Express, I believe it is a must-see article if you are working with IIS Express and having troubles.

A global directory for IIS Express

Applies To

IIS Express 8


Comments (0)

Skip to main content