I have been having a problem with the following snippet:
//Setting up AttributeDictio nary
SettingsAttribu teDictionary ad = new
SettingsAttribu teDictionary();
UserScopedSetti ngAttribute usera = new
UserScopedSetti ngAttribute();
ad.Add(usera.Ge tType(), usera);
// Adding new SettingsPropery
SettingsPropert y mySp= new SettingsPropert y("NewProperty" , typeof(String)
, new LocalFileSettin gsProvider(), false, "Hello World",
SettingsSeriali zeAs.String, ad, true, true);
//MySettings here is just the namespace of the project
// Add Property to Properties collection and saving
MySettings.Defa ult.Properties. Add(new
System.Configur ation.SettingsP roperty("Anothe rProp"));
MySettings.Defa ult.Save();
Upon saving the new Property is not reflected in the User.config file
located
C:\Users\Admini strator\AppData \Local\AppName\ AppName.exe_\1. 0.0.0
Is there something I am doing wrong or is it just not designed to be used
this way as it appears that this code doesn't talk to the underlying
configuration subsystem only the settings subsystem
//Setting up AttributeDictio nary
SettingsAttribu teDictionary ad = new
SettingsAttribu teDictionary();
UserScopedSetti ngAttribute usera = new
UserScopedSetti ngAttribute();
ad.Add(usera.Ge tType(), usera);
// Adding new SettingsPropery
SettingsPropert y mySp= new SettingsPropert y("NewProperty" , typeof(String)
, new LocalFileSettin gsProvider(), false, "Hello World",
SettingsSeriali zeAs.String, ad, true, true);
//MySettings here is just the namespace of the project
// Add Property to Properties collection and saving
MySettings.Defa ult.Properties. Add(new
System.Configur ation.SettingsP roperty("Anothe rProp"));
MySettings.Defa ult.Save();
Upon saving the new Property is not reflected in the User.config file
located
C:\Users\Admini strator\AppData \Local\AppName\ AppName.exe_\1. 0.0.0
Is there something I am doing wrong or is it just not designed to be used
this way as it appears that this code doesn't talk to the underlying
configuration subsystem only the settings subsystem
Comment