Removing a staged app from Windows 10
Is there any way to remove an app that has been staged by the "SYSTEM" user?
I am using VS2019 to develop a UWP app (I'll call it TestApp for this post) that will be sideloaded for internal company use.
I am completely blocked the following error in Visual Studio when I try to test my app:
DEP0700: Registration of the app failed. [0x80073CFB] Another user has already installed a packaged version of this app. An unpackaged version cannot replace this.
The app does not appear in the System Settings > Apps list to be removed.
There are no other actual user accounts on my development machine.
Looking at my apps view powershell, I see that the "SYSTEM" user has a staged version of the app.
> Get-AppxPackage -AllUsers TestApp
Name : TestApp
Publisher : OU=Test
Architecture : X64
ResourceId : Version : 1.0.0.0
PackageFullName : TestApp_1.0.0.0_x64__blah
InstallLocation : C:\Program Files\WindowsApps\TestApp_1.0.0.0_x64__blah
IsFramework : False
PackageFamilyName : TestApp__blah
PublisherId : blah
PackageUserInformation : {S-1-5-18 [NT AUTHORITY\SYSTEM]: Staged}
IsResourcePackage : False
IsBundle : False
IsDevelopmentMode : False
NonRemovable : False
IsPartiallyStaged : False
SignatureKind : Developer
Status : Ok
I have tried to remove the app using:
Get-AppXPackage -AllUsers TestApp | Remove-AppXPackage -AllUsers
That does not give an error but does not remove the package.
I have tried the psexec -i -s -d powershell.exe
route in order to run the commands as the "SYSTEM" user.
I have verified that I am the SYSTEM user in this shell by running whoami
.
> whoami
nt authority\system
I have tried removing all the package types at the same time:
Get-AppxPackage -AllUsers TestApp -PackageTypeFilter Bundle, Main, Resource | Remove-AppxPackage -AllUsers
I have tried removing from -AllUsers
and the specific -User S-1-5-18
using the SID of the "SYSTEM" user.
Nothing works.
I have spent the better part of this entire day reading posts going back about 7 years describing variations of this issue.
It seems the failure to remove "Staged" apps is the latest manifestation.
I have seen bug reports in the Visual Studio community getting punted to the Operating System community (since this is a package manager issue) but not actually answered.
So... is there any way to actually remove an app that has been staged by the "SYSTEM" user?
Thank you for your help!