Custom Configuration at Application Directory Level

G

Guest

In reading MSDN docs on creating custom Configuration sections, I found this
page:

http://msdn.microsoft.com/library/d...luesectionhandlerdictionarysectionhandler.asp

At the very bottom, it says:

Configuration File
This element can be used in the application configuration file, machine
configuration file (Machine.config), and Web.config files that are not at the
application directory level.

What do they mean by "Web.config files that are not at the application
directory level." I thought this was the whole point of custom web.config
sections. If I have a web service running in

http://myserver/MyWebService/myEndpoint.asmx

Does this mean I can't define a custom configuration section in a web config
at:

http://myserver/MyWebService/web.config


Thanks in advance,
Mike
 
J

Juan T. Llibre

Hi, rdcpro.

You can have web.config files, which determine
how the Application responds, in subdirectories
of the Application.

You could have different web.config files in *every*
subdirectory of the Application if you so wished or needed.

OTOH, you can only have one global.asax for the Application.




Juan T. Llibre
ASP.NET MVP
===========
 
C

Craig Deelsnyder

In reading MSDN docs on creating custom Configuration sections, I found
this
page:

http://msdn.microsoft.com/library/d...luesectionhandlerdictionarysectionhandler.asp

At the very bottom, it says:

Configuration File
This element can be used in the application configuration file, machine
configuration file (Machine.config), and Web.config files that are not
at the
application directory level.

What do they mean by "Web.config files that are not at the application
directory level." I thought this was the whole point of custom
web.config
sections. If I have a web service running in

http://myserver/MyWebService/myEndpoint.asmx

Does this mean I can't define a custom configuration section in a web
config
at:

http://myserver/MyWebService/web.config


Thanks in advance,
Mike

I think they mean 'application configuration file' can be web.config, as
it's the app config file for a web app. Then, in addition, you can use it
in web.config files in subdirectories of a web app. A little confusing,
but they're trying to cover web and windows apps in one sentence (page).
 
S

Steven Cheng[MSFT]

Hi Mike,

The
=================
Configuration File
This element can be used in the application configuration file, machine
configuration file (Machine.config), and Web.config files that are not at
the application directory level.

=================

in the MSDN reference is focus on asp.net configuration scenario. Every
asp.net web application (in IIS) will be hosted in an Virutual dir which is
configured as "Application". And this virtual dir is called the root
directory of the asp.net web application.( there may exists many hierarchy
of sub dirs under it). And we can put web.config file in both root dir or
sub dir( roor dir's web.config is not optional). However, not all those
xml config element are allowed to used in the sub dir's web.config, some
are only allowed to appear once for each asp.net web application (in the
root dir's web.config). That's why each config element in MSDN 's schema
reference will have the above notes.

=================
Configuration File
This element can be used in the application configuration file, machine
configuration file (Machine.config), and Web.config files that are not at
the application directory level.

=================

this means that this element can be used not only in asp.net application's
root dir's web.config but also in subdir's web.config file.

If there is still anything unclear, please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
G

Guest

Ok, thanks! I see that I read it wrong. I thought it was saying you couldn't
do this at the root level, only in subdirs! Doh.

Thanks to all who responded.

Mike
 
S

Steven Cheng[MSFT]

You're welcome Mike,

Have a good day!

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

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,774
Messages
2,569,598
Members
45,150
Latest member
MakersCBDReviews
Top