ConfigurationManager.AppSettings[“SettingName”] vs Properties.Settings.Default.SettingName when should I use each?

后端 未结 4 1726
悲&欢浪女
悲&欢浪女 2021-02-04 01:11

What should dictate when I should use the configurationManager.AppSettings or the strongly typed settings that visual studio generates? The strongly typed ones seem much more a

4条回答
  •  [愿得一人]
    2021-02-04 01:58

    From what I read, looks like AppSettings is the older way of doing things. MSDN docs states that user settings can be written at run time if you are using settings.

    I always prefer strongly typed settings, which can be implemented with ConfigSection handlers.

    Pros and cons of appSettings vs applicationSettings (.NET app.config)

提交回复
热议问题