简体   繁体   中英

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:

在此输入图像描述

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.

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.

配置管理器


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.

尝试从本地计算机上卸载旧版本的应用程序,然后从visual studio再次运行它

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM