Save and reload app.config(applicationSettings) at runtime

前端 未结 4 496
攒了一身酷
攒了一身酷 2020-12-01 16:57

I\'ve stored configuration of my application in the app.config, by Visual Studio I\'ve created some application key on the settings tab of project properties dialog, then I\

4条回答
  •  半阙折子戏
    2020-12-01 17:05

    I did a some tests and here is result.

    For auto generated class Settings the call of ConfigurationManager.RefreshSection("applicationSettings"); doesn't apply the modified values for members marked with ApplicationScopedSettingAttribute, it applies the changes to future calls via ConfigurationManager members (and not sure about UserScopedSettingAttribute).

    Instead call Settings.Default.Reload();

提交回复
热议问题