iis - Adding custom section to web.config in ASP.NET 4 -


i've spent half of day trying understand why following fails.

i can add section anywhere never got working ():

<?xml version="1.0" encoding="utf-8"?>   <configuration>         <mysection />         <system.web>        <compilation debug="false" batch="false" targetframework="4.0" />        </system.web>        <system.webserver>          <handlers>          </handlers>        </system.webserver>   </configuration> 

i think error related .net 4, because when put section without pre-configuration in applicationhost.config shows error gray border saying config incorrect. expect. add section definition , seems work can edit config console - means parsed correctly now.

but when try reach application, gives:

parser error message: unrecognized configuration section mysection

with piece of config on yellow background.

or need write module consume settings ? @ moment not have any, text in config.

following links understand this.

http://www.codeproject.com/articles/32628/asp-net-custom-web-configuration-section

http://www.4guysfromrolla.com/articles/032807-1.aspx

regards,


Comments