Andrey Ershov
Andrey Ershov

Reputation: 1803

Load parts of App.Config from a webService

Imagine a highly distributed system with same self-hosted WCF services on different machines. It's a pain to manage all App.Config files in a decentralized way.

I am sure there is a solution to load one Config section or a key value setting from some custom web-service, but I was not able to find a solution.

Upvotes: 0

Views: 75

Answers (1)

Wicher Visser
Wicher Visser

Reputation: 1543

You can read the configurations from the section in your appConfig through

System.Configuration.ConfigurationManager.AppSettings.Get(key)

System.Configuration.ConfigurationManager has other configuration accessors, for example

ConfigurationManager.ConnectionStrings[name]

For documentation see https://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k(System.Configuration.ConfigurationManager);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.5);k(DevLang-csharp)&rd=true

Upvotes: 1

Related Questions