Is there a way to make a configuration section that would allow a freeform XML body? How would I get that freeform body in code?
For example I'd like to create a ModuleConfigurationSection like this:
<modules>
<module name="ModuleA" type="My.Namespace.ModuleA, My.Assembly">
<moduleConfig>
<serviceAddress>http://myserver/myservice.svc</serviceAddress>
</moduleConfig>
</module>
<module name="ModuleB" type="My.Namespace.ModuleB, My.OtherAssembly">
<moduleConfig>
<filePath>c:\directory</filePath>
</moduleConfig>
</module>
</modules>
So some code would spin up each of these module types from config sections using ConfigurationManager.GetSection("modules")
and I'd like to pass the XML inside the moduleConfig
element as an opaque configuration value to the constructor of the module class.
Any input appreciated!