473,792 Members | 3,251 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

web.config does not allow section names with dots

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.Prod uct.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
Nov 19 '05 #1
4 1258
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

"Vagif Abilov" <va***@online.n o> ha scritto nel messaggio
news:eT******** ******@tk2msftn gp13.phx.gbl...
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.Prod uct.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

Nov 19 '05 #2
Hi Stefano,

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

<configSections >
<section name="MyCompany .Workflow"
type="System.Co nfiguration.Nam eValueSectionHa ndler" />
</configSections>

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

<MyCompany.Work flow>
<add key="MyKey" value="MyValue" />
</MyCompany.Workf low>

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

Vagif

"Stefano" <st************ ****@giasoft.it > wrote in message
news:eu******** ******@TK2MSFTN GP12.phx.gbl...
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

"Vagif Abilov" <va***@online.n o> ha scritto nel messaggio
news:eT******** ******@tk2msftn gp13.phx.gbl...
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.Prod uct.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


Nov 19 '05 #3
> Hi Stefano,

Hi Vagif
Did you try it in a Web project?
Yes, sure.
My section looks like this:
<configSections >
<section name="MyCompany .Workflow"
type="System.Co nfiguration.Nam eValueSectionHa ndler" />
</configSections>


I'm using my own custom handler, not the NameValueSectio nHandler directly.
So, maybe this is the difference.

Check out:
http://support.microsoft.com/kb/309045/en-us

HTH

Bye

Stefano
Nov 19 '05 #4
OK, I see. I will try with custom section handlers then.

Thanks!

"Stefano" <st************ ****@giasoft.it > wrote in message
news:OC******** ******@TK2MSFTN GP15.phx.gbl...
Hi Stefano,


Hi Vagif
Did you try it in a Web project?


Yes, sure.
My section looks like this:
<configSections >
<section name="MyCompany .Workflow"
type="System.Co nfiguration.Nam eValueSectionHa ndler" />
</configSections>


I'm using my own custom handler, not the NameValueSectio nHandler directly.
So, maybe this is the difference.

Check out:
http://support.microsoft.com/kb/309045/en-us

HTH

Bye

Stefano

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2669
by: Klaus Jensen | last post by:
Hi! I have a pretty traditional setup where I develop on my local PC and the use "Copy Project" to deploy to the production enviroment.. In web.config I need different values for connectionstrings etc for development and production - pretty normalt stuff. Currently I edit the web.config manually before deploying, and have never forgotten - but I know it is a matter of time before I or a colleague do.
4
5393
by: tommy | last post by:
hello everbody, i write a little asp-application with forms-authentication. i copy my aspx-files with web.config to my webspace and i get the error above... i tried to set the custom-errors-tag ="off" but nothing happens.... what is my failure????
0
5910
by: Adam Getchell | last post by:
I'm attempting to write a custom Authentication module using http://www.15seconds.com/Issue/020417.htm I looked at http://support.microsoft.com/default.aspx?scid=kb;EN-US;307996, but it doesn't setup things the way I want (ie, I want to integrate into an existing web application). So I want to deny unauthenticated users access to everything except the default page. I have an error in web.config. When I comment out these lines: ...
3
1540
by: Dan | last post by:
hi ng, i'd like to add control elements on a page, but only for users that are authotized to access a certain location, defined in web.config. my question: is it possible to read the <allow users="" /> section of a <location> in web.config, or do i have to add these users as key-value elements that can be accessed by AppSetting... ? i didn't find another solution, but that way is very unconfortable in a environment with many users.
9
6478
by: Benny Ng | last post by:
Hi,all, How to let the sub-directory to avoid the authentication control from Root's webconfig? I heard that we can add a new web.config to the sub-directory. And then we can slove the problem. Virtual directory is £ºhttp://localhost/main Sub-directory is : http://localhost/main/reminder
4
2901
by: WB | last post by:
I'm just starting out with C# after many years with VB 6.0. I'm trying to fill a listbox with a list of computer names (almost 100) from app.config. First, is app.config the place to store and retrieve this large list? If so, I'm looking for code to obtain the list of computer names from app.config, and also an example of how the computer names need to be listed in app.config.
8
1910
by: aabdis | last post by:
Hello All.... I have a question... i have two Windows apps (one UI, and one service) which use a common DLL that hands out database results and such to the two apps. The DLL always connects to the DB the same way, regardless of which app calls it. So i wanted to store info in the config file for the DLL... only to find out it wont read that file at all. I am using VS2005. Searching online, i find that DLLs WILL NOT read their own...
3
6031
by: wizofaus | last post by:
I've now created the same setup on four different machines, where I'm changing the processModel section machine.config so that ASP.NET (1.1) runs as SYSTEM, to give it permission to do various things like access the Task Scheduler etc. Three of the machines are using IIS 5.1 and work fine. The 4th machine is using IIS 6.0, and also has ASP.NET 2.0 installed (but I've made sure that the IIS application in question is using ASP.NET 1.1). ...
0
2908
by: j | last post by:
I'm trying to write a section of code so that several applications that all share some configuration options can load those options from a single .config file. This code compiles and executes w/o error, but it will not return the contents of any config file I give it. The code to dump the sections always reports sections that do not exist in the file. Looking at appConfig.Type, the public key does not match the one in the file.
0
10430
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10211
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9033
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.