DotNetNuke web.config exceeding maximum size

1k views Asked by At

I have a website using DotNetNuke, and after a few days running normally it started to return "Internal Server Error" for any request, including images or any other file type. After some investigation, I noticed that web.config file size had exceeded the maximum allowed size, due to several upgrade comments added by DotNetNuke. Replacing web.config with the original "clean " version solved the problem temporarily, but DNN is still writing those comments until reach the size limit.

Does anyone knows a way to change/disable this behavior, so I don't have to almost-daily clean my web.config? Thanks in advance!

2

There are 2 answers

1
Chris Hammond On BEST ANSWER

I think you need to look into why DNN is continually writing to the web.config, something is wrong with your installation, DNN should only write at the time you perform an upgrade. When you last upgraded did you have any errors?

Perhaps around the telerik installation? Check your INSTALL folder (and subfolders) for any ZIP files, after an upgrade completes there shouldn't be any ZIP files remaining in those folders.

1
Kapil Khandelwal On

If you are looking for increasing Web.config size limit, you can update the registry key value as explained below:

HKLM\SOFTWARE\Microsoft\InetStp\Configuration\MaxWebConfigFileSizeInKB (REG_DWORD)

Note: If you configure IIS 7.0 and IIS 7.5 to run in 32-bit mode on Windows Server 2008 x64 or on Windows Server 2008 R2 x 64, the registry key is instead the following:

HKLM\SOFTWARE\Wow6432Node\Microsoft\InetStp\Configuration\MaxWebConfigFileSizeInKB (REG_DWORD)

The Nativerd.dll file uses the value of this registry key to determine the maximum allowed size, in KB, of the Web.config files. The Configuration system assumes a default value of 250 KB in Windows Server 2008 and 100 KB in the release version of Windows Vista. If a Web.config file is larger than 250 KB in Windows Server 2008 or 100 KB in the release version of Windows Vista, you notice the following error message in the Configuration system: Cannot read configuration file because it exceeds the maximum file size If you change the value of this key, you must restart the process.

See this for more details