prestomanifesto
prestomanifesto

Reputation: 12816

Custom Configuration Section in system.web

How can I add a custom configuration section to a .NET web.config file under the existing <system.web> section?

Upvotes: 1

Views: 159

Answers (2)

Geethanga
Geethanga

Reputation: 1846

You are not allowed add custom config sections inside <system.web>. You can have your custom config sections under <configuration>. Check this how to.

Upvotes: -1

Aghilas Yakoub
Aghilas Yakoub

Reputation: 29000

Try with this code

<configSections>
    <section name="" type="System.Configuration.DictionarySectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <sectionGroup name="system.web">
      <section name="test" type="DataSetSectionHandler,SectionHandlers" />
    </sectionGroup>
  </configSections>


<system.web>
    <compilation debug="true"/>
    <authentication mode="Windows" />

    <test  attribute="..."  />
  </system.web>

Upvotes: 3

Related Questions