473,395 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

selecting your web.config

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
Nov 18 '05 #1
5 1223
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.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Shaun Wilde" <sh*********@nospam.co.uk> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
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

Nov 18 '05 #2
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.
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:#0**************@TK2MSFTNGP09.phx.gbl...
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.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Shaun Wilde" <sh*********@nospam.co.uk> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
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


Nov 18 '05 #3
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.)

Nov 18 '05 #4
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

"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:oT**************@cpmsftngxa10.phx.gbl...
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.)

Nov 18 '05 #5
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.)
Nov 18 '05 #6

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

Similar topics

4
by: Fuzzyman | last post by:
There have been a couple of config file 'systems' announced recently, that focus on building more powerful and complex configuration files. ConfigObj is a module to enable you to much more *simply*...
1
by: Teeravee Sirinapasawasdee | last post by:
How can we select between .NET Framework 1.0 and .NET Framework 1.1 in Visual Studio .NET if we install both of them?
1
by: Ramesh | last post by:
hi, I am selecting fields from three table for manupulating data and i want to display total number of records selected. But i am always getting -1 value, eventhough 1000 of records are selected....
3
by: larry mckay | last post by:
anyone have the code to select and listview item or row (subitems) after a doubleclick event from a listview. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate...
11
by: Ron L | last post by:
I have a data table that lists a series of items in my database. In my user form, I want the user to be able to filter by a number of criteria (e.g. location, contract, date modified, etc). Other...
11
by: TARUN | last post by:
Hello All I need to ask about the configuration file in .NET, There are Two config File 1. Web Config 2. Machine config I understand the the usage of Web config , but not able to understand...
8
by: John Barleycorn | last post by:
Hi I'm sorry if this question is a bit basic for most people, but I'm really new to VB (I'm using the .NET 2005 Express Edition), but I've set myself a task and would love to see it through. ...
3
by: Tony K | last post by:
Hi all, I have an inventory application I'm writing for the company I work for and realized the path for the Access database might reside on a network drive. I have used Microsoft's Add Data...
2
by: berutti | last post by:
Hi all, I have this problem. My program should analyze some data and it features a configuration file in which it's defined the data source (could be plain text or MYSQL data). To do so I made two...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...

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.