I'm working on a UWP app and I need data to be stored as the setting.
I use ApplicationData.Current.LocalSettings
and I store a mix of simple data and composite data in it. When my app user wants to end its session, I want all data that I stored before, to be deleted. I used ApplicationData.Current.ClearAsync()
, ApplicationData.Current.LocalSettings.Values.Clear()
and it seems it works but when I check settings.dat file which is where those settings are stored, I see data is still there and only their connection with their keys are cleared and made them unavailable.
The problem is from version to version there are situations that I need to change some of the keys or even stop using some of them and with this issue I described, data related to previous keys will remain in settings.dat and file size grows over time.
I need a solution to let me clear settings.dat content (or at least contents which I've written in it) completely.