This question already has an answer here:
I would like to update my Windows Store App, but I need to delete everything in the local state folder of the application:
C:\Users\usr1\AppData\Local\Packages\myApp\LocalState
I am not familiar with the process of updating Windows Store App and the official documentation does not clarify how can I clear the folder just as if the App was reinstalled.
I was wondering if I had to do this by hand (using the version number of the App) or if there was an automated way to perform it.
Let me first give a little background. By design, app data is preserved across the installation of app updates. The reason for this is that the versions of your state (app data) are typically a separate concern from the versions of the app itself. That is, an app could go between versions 1.3 and 4.1 and still use the same app data structures.
The version of the app data is set through Windows.Storage.ApplicationData.SetVersionAsync (http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.applicationdata.setversionasync.aspx). Where this primarily matters is with roaming data, as this version mark determines what distinct copies of the roaming data are preserved in the cloud.
Now in your case you're talking about local app data, not roaming, in which case you can either use SetVersionAsync, or you can simply maintain a version number in an app data setting yourself. For your scenario (which sound like clearing out a cache of sorts), using your own setting is probably better, because if/when you use roaming state you won't be having to change the app data version with every app update.
If you have a version number of your own, then, simply write your updated app to check for whatever version you don't want to carry forward. If that version exists, then call ApplicationData.ClearAsync(ApplicationDataLocality.Local) (see http://msdn.microsoft.com/en-us/library/windows/apps/hh701425.aspx). You can call ClearAsync with no args to clear local, temp, and roaming all together.
If for any reason you have state that can be migrated instead of rebuilt, then you can use that version number to check for what you need to migrate.
The other way to do this is to use a background task with the ServicingComplete trigger. A guide for that is here: http://msdn.microsoft.com/en-us/library/windows/apps/jj651556.aspx. You'd basically just have the background task call ClearAsync as before and/or migrate the state.