kkyr
kkyr

Reputation: 3845

Visual Studio not deploying when running

I'm building a UWP app in Visual Studio and after cloning my project from GitHub on a separate system, my TemporaryKey.pfx was missing and I generated a new one in the manifest.

I noticed that after doing so each time I clicked on the run button:

enter image description here

it would run the application that was currently deployed on my system. Ever since I've been using this button in VS it usually built my project, deployed it and then ran it whereas now it just runs the application that has already been deployed previously.

This means that every time I make a change in code I have to right click my project to deploy before running it to see any changes.

Can't figure out why this is happening, but I suspect it's due to the key mentioned in the beginning.

Upvotes: 4

Views: 2131

Answers (2)

Bart
Bart

Reputation: 10015

When I encountered the issue that my app didn't want to run the latest version, it usually was because the deploy (and sometimes even build) action was unchecked in the configuration manager. Also make sure your configuration is set to x86 to run on your local machine. UWP apps should NOT have a AnyCPU configuration (only PCLs do).

Right-click your solution to open the configuration manager.

Configuration manager


Bonus: For UWP apps I usually add following lines to my .gitignore file.

# Allow demo temporary keys
!*_TemporaryKey.pfx

# NuGet
*.nuget.props
*.nuget.targets
*.lock.json

Key files (.pfx) are ignored by default, which is good! But adding the TemporaryKey.pfx file saves you a lot of trouble. The NuGet extensions added are files that are regenerated on each build, so best to not add them to your version control either.

Upvotes: 4

Ken Tucker
Ken Tucker

Reputation: 4156

Try uninstalling the old version of the app from the local machine and run it again from visual studio

Upvotes: 0

Related Questions