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

Sam Holder picture Sam Holder · Dec 16, 2009 · Viewed 10.8k times · Source

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 appropriate in most cases, but I suppose that it would be possible to add settings dynamically to a deployed application using the ConfigurationManager approach, but are there any guidelines under which circumstances each is designed to be used?

Answer

ram picture ram · Dec 16, 2009

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)