Today I would like to tell about one specific deployment problem occurred on Visual Studio 2019 v16.2.0 and steps for solving it.
Registration of the app failed.
This may happen if you switching git branches with opened Visual Studio instance. And from this moment you can’t deploy your UWP app.
Ok, so what should we do with it? And here we have a couple of solutions, it’s depended by the depth of your glitch.
I will start with a dummy solution. Just restart your Visual Studio. Restarting Windows is not required here, rarely in such situation restart will help to solve our problem.
P.S. At the end in all next solutions we will restart Visual Studio instance, it’s important and required to affect solution changes.
- Find app in Start Menu or in Apps&Features and remove it.
- Restart VS.
- Be happy 😋.
Ok, you made First and Second solutions but still get that error during deploy in VS?
You may be wondering again why?
Welcome to more hardcode way to clean up windows from appx applications 🙃
Now we will:
- Get List of registered Appx Packages
- Find our Appx. (easiest way by Publisher, because it’s shown on Error List Window)
- Remove that Package for all Users
- Check that it’s removed.
- Restart VS 😜
Looks simple, right? Let’s begin!!!
Please run your PowerShell Console in Administrator Mode!!!
Command to get registered packages
get-appxpackage. We need to add a flag
-all for list all in the system.
Command to remove the package
remove-appxpackage required PackageFullName as the parameter. Also, we need to add a flag
-AllUsers to remove for all Users.
That’s all 🙂 🙂 😉. Thanks for reading, hope it will help you 😃
P.S. => Later I found this article, on MSDN Blog https://blogs.msdn.microsoft.com/wsdevsol/2013/01/28/registration-of-the-app-failed-another-user-has-already-installed-a-packaged-version-of-this-app-an-unpackaged-version-cannot-replace-this/