本文介绍了在重建WP8 Silverlight解决方案后,IsolatedStorageFile存储中的所有文件都将消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个WP8 Silverlight应用程序,该应用程序使用IsolatedStorageFile存储应用程序的数据。在某些时候,我发现如果在VS.NET中发出重建解决方案命令,VS会将我的项目完全部署到仿真器或连接的设备,而不是增量部署。在这种情况下,典型的Build输出如下所示:

I'm developing a WP8 Silverlight app which uses the IsolatedStorageFile store for app's data. At some point I detected that if I issue the Rebuild Solution command in VS.NET, VS uses full deployment of my project to the emulator or an attached device instead of incremental deployment. The typical Build output in this case looks like this:

当然,存储在IsolatedStorageFile中的所有应用的设置和数据都消失

Sure, all app's settings and data stored in IsolatedStorageFile disappear at that.

作为开发人员,我可能需要不时地重建我的解决方案,或者从我做的归档备份中解压缩。但是这意味着,在重建项目后,当我在Marketplace中发布新版本的应用程序时,我的最终用户也将丢失所有数据!

As a developer, I may need to rebuild my solution from time to time, or unpack it from the archive backup I do. But this means that my end users will lose all their data too when I publish a new version of my app in the Marketplace after rebuilding the project!

我的问题是如何在将重建的WP8 Silverlight项目部署到该设备之后,保存设备上的所有数据?是否有一个文件,或在编译时生成的文件中的一个文件(可能是GUID或时间戳)?哪些可以保存并添加到新的重建的东西,以防止下一个应用程序部署时的数据丢失?

My question is how to save all the data on the device after deploying a rebuilt WP8 Silverlight project to it? Is there a file, or a setting in one of the files produced while compilation responsible for that (maybe, a GUID, or time stamp)? Which can be saved and added to the new rebuilt stuff to prevent data loss with the next app deployment?

推荐答案

IsolatedStorage数据被删除每当应用程序被卸载,这正是VS在重建项目时所做的工作。最终用户将更新您的应用程序时不会这样。该应用将被更新而不是卸载。所以这将保留您的数据从IsolatedStorage。

IsolatedStorage data are deleted whenever the app is uninstalled, which is exactly what VS does when you rebuild the project. This will not be the case when end users will update your app. The app will be updated rather than uninstalled. So that will preserve your data from IsolatedStorage.

这篇关于在重建WP8 Silverlight解决方案后,IsolatedStorageFile存储中的所有文件都将消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 07:57