Hello,
I would like to ask about how to use web.config file jointly how to use
machine.config.
I'm going to explain my problem: I'm working with BizTalk Server 2006, but
by means of web services. So, I have several web services and on each web
service there is a web.config document with its connection string defined.
At the same time, in the same server, in machine.config document I have the
same connection string defined. (It's needed for a BizTalk web service)
My question is if it exists some property or attribute in order to when one
web service with web.config use its connection string, and when the other we
b
service which use machine.config use its connection string. I mean, change
the hierarchies, depend on the web service, use the web.config which is unde
r
the folder where the web service was created."Sendam_ Luque" <Sendam_ Luque@.discussions.microsoft.com> wrote in message
news:7B8F649C-19CE-4A97-A2BC-C2ACDC9CA25F@.microsoft.com...
> Hello,
> I would like to ask about how to use web.config file jointly how to use
> machine.config.
> I'm going to explain my problem: I'm working with BizTalk Server 2006, but
> by means of web services. So, I have several web services and on each web
> service there is a web.config document with its connection string defined.
> At the same time, in the same server, in machine.config document I have
> the
> same connection string defined. (It's needed for a BizTalk web service)
> My question is if it exists some property or attribute in order to when
> one
> web service with web.config use its connection string, and when the other
> web
> service which use machine.config use its connection string. I mean,
> change
> the hierarchies, depend on the web service, use the web.config which is
> under
> the folder where the web service was created.
>
Not sure I follow you 100%, but I can tell you that machine.config and
web.config are "merged" (in memory, not physically) by the
ConfigurationManager class. So the ConfigurationManager will load all
connection strings from machine.config *and* all connection strings from
web.config. You can access any connection string from either file the same
exact way. To test this, try putting a connection string in your web.config
with the same "name" as the connection string in your machine.config. You'll
get an error.
Now, having said that, it's fairly common for people to start off the
<connectionStrings> element of their web.config with a <clear/> tag. What
that does is effectively remove all previously loaded connection strings
(namely, those loaded from machine.config). If your web.config contains this
<clear/> tag then the connection strings defined in machine.config will be
unavailable.
Does that help at all, or are you simply trying to do something completely
different?
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment