ApplicationSettingsBase.Save does not save when a setting is changed indirectly - by Martin S. Müller

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 777670 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 1/28/2013 4:52:17 AM
Access Restriction Public


Consider this code:

using System.Collections.Generic;
using System.Configuration;

class Program
   static void Main(string[] args)
      Settings settings = new Settings();
      settings.S = new List<string>();
      List<string> l = settings.S;

   class Settings : ApplicationSettingsBase
      public List<string> S { get { return (List<string>) this["S"]; } set { this["S"] = value; } }

After the first save, the property S is changed without accessing settings["S"]. The change will not be saved to the xml settings file. However, if the change is done e.g. settings["S"].Add("two"), it will get writting the the xml settings file.

I am pretty sure this is by design. However, this behaviour is not obvious and I could not find any documentation about this behaviour.
Sign in to post a comment.
Posted by Martin S. Müller on 2/26/2013 at 12:22 AM
Maybe it would be helpful to document this behavior.
Posted by Microsoft on 2/21/2013 at 7:25 AM
Thank you for your feedback. We are not going to be able to address this issue in our next release due to other priorities.

Immo Landwerth
.NET Framework team
Posted by Microsoft on 1/30/2013 at 1:11 AM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 1/28/2013 at 5:51 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(