Pick up Variable from one Config directly on in another Config

Asked

Viewed 190 times

1

A doubt. Is it possible to take the value of a variable from one config directly within the other config? Possible example below.

Config1.config:

<add key="webservice" value="http.teste.com" />

Config2.config:

<add key="webservice" value="Config1.config:key("webservice").value" />

Are configs of Winforms C#

  • Instead of putting this: Config1.config:key("webservice").value places in config2 the key of config1, in case the "webservice". I think it gets cleaner, in the code you create a method to pursue this.

1 answer

2


You can’t do that.
The values in the configuration files are static, so that if you have a web application and edit Web.config, the application undergoes a Restart to "pick up" the new values, unless you specify restartOnExternalChanges="false".

Browser other questions tagged

You are not signed in. Login or sign up in order to post.