I'm writing C# that is running as a sandboxed plugin for a piece of 3rd party software. As a result, I cannot load config by specifying a file for ConfigurationManager.
I can however, set up a file on the 3rd party server and retrieve the contents as a string.
Ideally I would like to feed my config-as-string into the ConfigurationManager and have a normal C# config system. I've read the docs but couldn't see any to init config with a string (or buffer). Is there a reasonable and easy way to do this?
My fallback plan is to make a simple format of [key]=[value]\n and loading that into a Dictionary. I'd just like to avoid creating and maintaining a config system if possible.
I know you don't want to, but you can always roll your own. Which is just what we did in a similar situation. I posted some code I wrote for managing configuration that is thread-safe here:
Where to store "factory defaults" configuration settings, so they may be updated programmatically
My post is at the bottom.