WP7 - 在“重建"时擦除了隔离存储设置; [英] WP7 - Isolated Storage settings wiped on "Rebuild"

查看:34
本文介绍了WP7 - 在“重建"时擦除了隔离存储设置;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚发现(艰难的方式),如果您在从 Visual Studio 执行重建"或清理 -> 构建"后将应用程序部署到设备,您的应用程序首先会被卸载,然后重新安装,从而导致隔离存储正在擦除的文件.

I just discovered (the hard way) that if you deploy your application to a device after doing a "Rebuild" or a "Clean -> Build" from Visual Studio your app is first uninstalled and then reinstalled resulting in the isolated storage files being wiped.

应用程序部署工具似乎总是会卸载 - 重新安装,无论它是否是增量构建.

The Application Deployment Tool always seems to do uninstall - reinstall irrespective of whether it was an incremental build or not.

有没有人找到解决方法?当然,最明显的一个是永远不要重建你的应用程序,但是如果你不小心这样做了怎么办?目前,我没有在源代码管理下所有生成的文件,所以如果我尝试在另一台计算机上构建应用程序,它将是一个重建(如果没有人有一个,也许我会将所有生成的垃圾添加到源代码管理中)解决方法)

Has anybody found a workaround to this? Of course, the most obvious one is never to rebuild your application, but what if you accidentally do? Currently, I don't have all the generated files under source control, so if I were to try to build the app on another computer it would be a rebuild (maybe I will add all the generated junk into source control if no one has a workaround)

推荐答案

如果我能建议一个替代方法.. 我想如果你能在你的生成过程中引入一个小过程,你会发现它在其他情况下也是有益的.测试数据,以便更容易 a) 恢复或 b) 生成.

If I can suggest an alternative appraoch.. I think you will find it beneficial in other situations as well if you can introduce a little process to the generation of your test data so that it is easier to either a) restore or b) generate.

例如,您可以使用仅调试构建功能将设备上的文件上传/下载到在您的 PC 本地运行的 wcf 服务(Rongchaua 所做的简化版本此处).

You could for example have a debug build only feature to upload/download the files on the device to a wcf service running locally on your PC (a simplified version of what Rongchaua did here).

或者,如果您愿意,可以做更多工作,但提供更多额外好处是在您的应用中开发一些自动化测试功能......从生成初始测试数据开始.您可以查看以下内容以开始走上这条道路.

Or, more work, if you are willing, but offering even more additional benefits would be to develop some automated testing capability into your app.. starting with generation of initial test data. Here's something you could look at to get started on that path.

克劳斯康拉德博客:WP7:如何对 MVVM Light WP7 应用程序进行单元测试

当然,这些需要一些努力,但这种方法可以让您独立于手动生成的测试数据,根据我的经验,这在不同时间总是很麻烦.一旦解决了,您就会找到各种理由感谢自己后来做这件事……无论是节省时间,还是进行更健壮的测试,因为您可以更积极地处理测试数据/测试执行并管理多个测试数据配置.

Granted these would take a bit of effort, but it's an approach that gives you some independence from manually generated test data, which in my experience invariably turns out to be a hassle at various times. And once solved, you find all sorts of reasons to thank yourself for doing it later.. whether it be saved time, or more robust testing because you can afford to be more aggresive with your test data/test execution and manage multiple test data configurations.

这篇关于WP7 - 在“重建"时擦除了隔离存储设置;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆