I have a client apllication that run in very restricted area - it has no direct access to computer, where it is running. I don't want to invent another one System.Configuration system to configure my application.
But there is no method in ConfigurationManager, that allows to load configuration from string or Stream.
It seems to开发者_运维百科 me that it's impossible to use a ConfigurationManager in this particular scenario, but may be (and I hope to) wrong?
ConfigurationManager
and WebConfigurationManager
work exclusively with configuration files. This is because of the way the .NET configuration system is designed to cascade through folder hierarchies.
If you don't have access to the file system from your application, you wont be able to work with these classes.
Maybe you can try by using IsolatedStorage to store a config file and load it when you need it. But it depends on the sandbox you have. Are you using web, silverlight, clickonce?
精彩评论