将 Windows Phone 7.5 IsolatedStorage 的内容迁移到 Windows Phone 8.1

Migrating contents of Windows Phone 7.5 IsolatedStorage to Windows Phone 8.1

我有一个 Windows Phone 7.5 游戏,它将用户进度存储在位于 IsolatedStorage 的文件中。我现在正计划将代码升级到 WP 8.1。我不希望用户在更新时丢失进度,因此我需要在更新后以某种方式将用户文件从 IsolatedStorage 迁移到新的 StorageFile/StorageFolder 系统。

但是,到目前为止,我找不到从 WP 8.1 应用程序访问 IsolatedStorage 的方法。请告诉我我错了。我错过了什么吗?

隔离存储文件夹通过 Windows 运行时公开为 LocalFolder。您在 Windows Phone 8 Silverlight 应用程序和 Windows Phone 运行时应用程序中以相同的方式访问它。

StorageFolder localFolder = ApplicationData.Current.LocalFolder;

无需迁移。只要您的新应用作为现有应用的更新发布,用户的数据就会得到保留。

参见:Local folder best practices for Windows Phone 8 and Accessing app data with the Windows Runtime