app.config configuration sections are nice, but I often need multiple configuration sets, but with small difference. what I want is:
(note - it is also would be nice to place that "other section" in a separate file, but this is a different issue.)
Edit: the application is plain executable (or a service) - it is not a web service. Also, I know there is a "machine.config" to inherit from, but its too global: its for all apps together
The web. config file is required for ASP.NET webpages. The app. config file is optional in an application and doesn't have to be used when writing desktop applications.
Machine configuration files This file is located in the %runtime install path%\Config directory.
I think you'd have to use a custom handler to manage this.
The second part is easy as you can use an configSource Attribute in the original config file to point to a file that contains the xml source.
<system.serviceModel>
<diagnostics>
<messageLogging logMalformedMessages="true" logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="true" />
</diagnostics>
<bindings configSource="web.shared.bindings.config" ></bindings>
<client configSource="web.shared.client.config" ></client>
</system.serviceModel>
Here is how we link parts of the Service.ServiceModel XML into our Web Config so we can keep them seperate and easily edited.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With