Bob Clegg
Bob Clegg

Reputation: 573

Web.Config <appsettings> section breaks site

ASP.Net Data Retrieval site now erroring due to MS Patch limiting keys. Trying to put the following section into web.config to up the number of keys

<appsettings>
   <add key="aspnet:MaxHttpCollectionKeys" value="2000"></add>
</appsettings> 

Adding the section causes an Internal Server Error 'The configuration section 'appsettings' cannot be read because it is missing a section declaration'

Any idea how to correctly add this section? I have tried variations of examples on the Web but I can't get past this.

Upvotes: 2

Views: 3922

Answers (1)

PhilDearmore
PhilDearmore

Reputation: 135

Watch the case of the tags--I'm pretty sure web.configs are case-sensitive. Here is a full web.config, with appSettings nested inside of configuration...

<?xml version="1.0" encoding="utf-8" ?>
<configuration>   
    <appSettings>
        <add key="aspnet:MaxHttpCollectionKeys" value="2000" />
    </appSettings>
</configuration>

Upvotes: 8

Related Questions