问题
We want to develop an application that gets the configuration items from a json file and stores the key&values at ConfigurationManager.AppSettings. But AppSettings dictionary is readonly. We don't want to update or save the app.config file. This operation have to be at memory. Is there any way to do this?
回答1:
The answer was so easy. I found in the deep of other topics.
answer
ConfigurationManager.AppSettings.Set(configItem.Key, configItem.Value.ToString());
来源:https://stackoverflow.com/questions/46191584/how-to-set-app-settings-without-save-in-c-sharp