Unable to set outputCacheSettings in WebConfig file

2.7k Views Asked by At

I am Trying to implement outputcaching in my website When I try to add

    <outputCacheSettings>
    <outputCacheProfiles>
        <add name="TwoDay" duration="43200" />
    </outputCacheProfiles>
</outputCacheSettings>

This to my webconfig file it throws an error

    The configuration section 'outputCacheSettings' cannot be read because it is missing a section declaration

I have added above code inside

<configuration>

section in webconfig. Can any one tell me what I am doing wrong?

1

There are 1 best solutions below

3
CodeCaster On BEST ANSWER

Put it in the <caching> section in the <system.web> section as explained here on MSDN.