lg.lindstrom
lg.lindstrom

Reputation: 856

Clear roaming setting in winrt application

I am writing a winrt application using VS2012.

To detect application first time startup I am using a variable saved using roaming settings. If the specified setting is missing or have wrong value my application performs a initial setup sequence.

During development in VS2012 I have the need to clear this setting so the application performs a initial start.

I have found now way to do this,,,? How do I remove roaming settings for a application?

//lg

Upvotes: 1

Views: 360

Answers (2)

Call the [Windows.Storage.ApplicationData.ClearAsync method][1] that lets you specify a locality, in this case Windows.Storage.ApplicationLocality.Roaming.

This will clear everything out of roaming appdata and also flush the cloud, as I understand it. You can certainly reset individual values too, but ClearAsync is the most complete means.

Upvotes: 1

WiredPrairie
WiredPrairie

Reputation: 59763

I would just conditionally include code that removes the setting:

#if RESET_APP
roamingSettings.Values.Remove("exampleSetting");
#endif

Upvotes: 1

Related Questions