David Rector
David Rector

Reputation: 1026

How do I make Visual Studio update a Windows Store App, not replace it

I have a Visual Studio project for a Windows Store app written in C#. I want to test the app in a situation where a user updates from one version to another, but I can't. When I try to debug my app in Visual Studio, I get this message:

The app xxx is already installed on this machine. If you continue with the current deployment, the existing app will be uninstalled and the app's current state will be deleted.

I don't want to lose the existing state of the app because I wrote code to find the old version of some data and to update it.

Installing the previous version from the Windows Store, or from a side-load, both have the same effect. I can't then test the new version in Visual Studio.

Does anyone know a way to get Visual Studio to not delete the old version, and install the new version from scratch?

Upvotes: 1

Views: 364

Answers (2)

James Gardner
James Gardner

Reputation: 679

I know it's a little late but there is another way to do this.

  1. install the old version
  2. use the app to generate the data you want to test
  3. Copy the LocalState directory from C:\users\USERNAME\AppData\Local\Packages\APPNAME
  4. Do not close the app
  5. run the new app from Visual Studio
  6. Say yes to the prompt about removing the old app and data
  7. Kill the app at the first screen
  8. Copy the old LocalState dir back into the Packages dir
  9. Run the app from VisualStudio

Upvotes: 1

Shawn Kendrot
Shawn Kendrot

Reputation: 12465

You should not use the version from the Store. Simply deployy the app from Visual Studio (via debug). To test

  1. Set the version number to a previous number
  2. Deploy the app
  3. Use the app
  4. Change app version number
  5. Deploy the app
  6. Use the app

Step 6 is where you will notice the app has been updated.

Upvotes: 1

Related Questions