WP7: How to Simulate an Application Update

Scenario: You’re developing version 2.0 of your hugely successful Windows Phone application. You want to provide to your users a seamless experience when updating their app to this latest version. That is, you want bring over the current app state into the 2.0 version and not require the user to have to start all over again. You have included the necessary code to do this, but need a way to test it. You ask ‘ Is there any way to simulate an application update with the Windows Phone developer tools?’. You noticed that when using the ‘Application Deployment’ tool that the isolated storage for the app is initialized before the app is installed.

Yes you can simulate an application update. You need to use Visual Studio to do this. When Visual Studio deploys an application, it does not first uninstall the application.

Here is the process to simulate an app update. This will preserve the isolated storage between deployments.

1. Sideload the 1.0 XAP file to the phone or emulator using the ‘Application Deployment’ tool. (We’ll call this MyApplication.XAP)

2. Using Visual Studio create a dummy Windows Phone application (We’ll call this PhoneApp1)

3. Build PhoneApp1 (debug or release)

4. Open the folder where the PhoneApp1.xap is located (e.g. D:\p\PhoneApp1\PhoneApp1\Bin\Debug)

5. Delete PhoneApp1.XAP

6. Copy the updated XAP for your application to this folder (MyApplication.XAP 2.0).

7. Rename MyApplicaiton.XAP to PhoneApp1.XAP

8. Go back to Visual Studio

9. Right Click on Project

10. Select Deploy.

11. The 2.0 version of MyApplication.XAP will now be deployed to the Emulator / Phone. Note that the application binaries are updated, but the isolated storage is the same as before.

12. You can use Windows Phone Power tools to verify.