selecting your web.config

  • Thread starter Thread starter Shaun Wilde
  • Start date Start date
S

Shaun Wilde

I have a situation where I would like to choose the web.confg I get my
settings from.

I have 2 folders folderA and folderB and 3 web.configs the main root
web.config and a web.config in each of the folders to override settings from
the web.config above it.

now when a call a webservice in folderA and I start up an Asynchronos
Delegate (AD) to do some work for me - in the AD worker part of the process
if I access configuration information I only get that which is in the root
web.config and not that which is in folderA (the required one). The same
applies for folder B and any AD it generates.

I am using custom configuration section handlers to parse my complex
configuration held in their own sections within the web.congs

Is there a way for my AD to switch "context" so that it gets the required
web.config?

Thanks

Shaun
 
You can't switch web.config files but you can have one that has different
sections for different scenarios. The <location> tag is a prime example.
 
That is what I am trying to avoid - bundling it all in one web.config - I
like the override ability you have with web.configs and it has served me
well in the past.

If it truly can't be done - then I'll probably grab the config before the AD
is launced and pass it as a parameter.
 
Hi Shaun,

Thanks for your posting. Yes, I've also found the problem. I think this is
caused by the async delegate call is hosted on another thread who will load
the base web.config file. Currently I think there is no better means but to
get the Config setting items in the main webservice request thread rather
than in the async call thread.
Thanks.

Steven Cheng
Microsoft Online Support

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

The other issue I have is to how to control this for my WebService
Extensions - my ADs call other webservices and depending on where the
webservice was launched depends on what I would like my webservices to do
(custom seection handlers again) . e.g. which folder to log the packets in,
endcode/decode data - add additional authentication data that we wish to
keep secret.

I may for this scenario have to have a more complex root web.config and pass
some sort of parameter that can be picked up by the section handlers - I may
research more what MS do with their custom soap client but I supect that is
a header extension.

Shaun
 
Hi Shaun,

Thanks for your followup. Yes, I've also seen your another issue in the
newsgroup and I've got the project you attached in the message. I'll have
some tests on my side and update you when I got any progress. Also, if you
feel it convenient that we continue to discuss in that thread, please feel
free to followup there.
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.)
 

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

Back
Top