Answered by:

Trouble w/ ReadTextAsync and WriteTextAsync

Question

My store app was using ApplicationData.Current.RoamingSettings to store data, but I ran into the limit for the amount of data that can be stored there. So, I changed some of the settings to ApplicationDataCompositeValues to get more storage
and that worked better, but I decided that is still not enough storage space.

So now, I'm trying to use the ApplicationData.Current.RoamingFolder.GetFileAsync() to Read and Write the data to a file. It's working for the first set of data being read/written, but eventually the app hangs. It appears
that the await FileIO.WriteTextAsync(file,data) times out with no exception thrown.

The app is reading/writing to the file several times during startup. Note that the class for reading/writing these data is in a separate dll so my background task can read the data too (but the background task is turned off for now).

Does ApplicationData.Current.RoamingSettings do a better job of locking so only one thread can read/write at a time?

NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
objects and unknown namespaces.

NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
objects and unknown namespaces.

NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
objects and unknown namespaces.