web.config does not allow section names with dots

V

Vagif Abilov

Our .NET applications and Web sites use configuration files with custom
sections. It's no problem to read a section with dots in its name from a
Windows .NET application, e.g. "MyCompany.Product.Feature". However an
attempt to read such section from Web site's web.config file raises
exception ("Can not create section handler"). Once the dots are removed,
everything works fine. I have not found any documentation that describes
such behavior. Can anybody confirm this?

TIA

Vagif Abilov
Oslo Norway
vagif
@
online.no
 
S

Stefano

Hi Vagif,

I tried to create a dotted config section in web.config, using a custon
configuration handler.

Everything is OK. I've not that error.

Can you paste the code you're using for the config handler?

Bye

Stefano
 
V

Vagif Abilov

Hi Stefano,

Did you try it in a Web project? My section looks like this:

<configSections>
<section name="MyCompany.Workflow"
type="System.Configuration.NameValueSectionHandler" />
</configSections>

<appSettings>
<add key="Some key" value="Some value" />
</appSettings>

<MyCompany.Workflow>
<add key="MyKey" value="MyValue" />
</MyCompany.Workflow>

It works OK when I try to read configuration values from section
"MyCompany.Workflow" from Windows .NET application, but fails if I do the
same from ASP.NET application. However removing "." from the section name
helps.

Vagif
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top