jamesmontemagno / SettingsPlugin

Read and Write Settings Plugin for Xamarin and Windows
MIT License
324 stars 80 forks source link

Setting not persisting for UWP #120

Closed solomonfried closed 6 years ago

solomonfried commented 6 years ago

Failure to fill out this information will result in this issue being closed.

Bug Information

Version Number of Plugin: 3.1.1 Device Tested On: Local Machine Simulator Tested On: Version of VS: 2017 Version of Xamarin: 4.9.0 Versions of other things you are using: Xamarin.Forms 2.5.0.280555

Steps to reproduce the Behavior

I have the following code in App.xaml.cs

var name= CrossSettings.Current.GetValueOrDefault("NAME", ""); CrossSettings.Current.AddOrUpdateValue("NAME", "John Doe"); name= CrossSettings.Current.GetValueOrDefault("NAME", "");

I added a call to Application.SavePropertiesAsync() to no avail.

Expected Behavior

NAME Setting should persist between runs

Actual Behavior

values are stored while running, but on every restart the first GetValueOrDefault returns blank. This only occurs on UWP. The data is persisted when tested on Android.

No exceptions or errors are observed.

Thank you

Code snippet

Screenshots

solomonfried commented 6 years ago

RESOLVED! My error. I had been having other issues and set the Debug option in settings for "Uninstall and then re-install my package. All information about the application is state is deleted"