The Problem
When trying to run certain Provisioned Windows apps on Windows 1903, the apps seem to open and then just disappear very quickly—and this is the problem.
Troubleshooting
Upon inspecting the Event Viewer Application
logs, there are Event ID 1000
events logged. Furthermore, upon inspection of the Event Viewer | Application and Services Logs
| Microsoft
| Windows
| Apps
and within the Microsoft-Windows-TWinUI/Operational
log, there are Event ID 5961
events logged.
Event Viewer Error Codes
- Event ID: 1000: Exception code: 0xc000027b
- Event ID: 5961: Error code: Unknown HResult Error code: 0x80040904. Activation phase: COM App activation
Some of What I've Tried
I've tried running the below PowerShell and reinstall the applications that have this problem, and it appears to run without error, but the problem still occurs.
$wAppPath = (Get-AppxPackage -Name "*Calc*").InstallLocation;
Add-AppxPackage -Path "$wAppPath\Appxmanifest.xml" -Register -DisableDevelopmentMode;
-
I've also ran
sfc /scannow
and a few differentdism
commands, rebooted, and the problem persists regardless of all these things I've tried. -
I've also looked over and took a stab at some solutions listed in the Metro apps crash on startup, driver or permissions issue? post too.
-
And some of the solutions mentioned in the Windows 10 Edge Opens Momentarily and Then Disappears post, and nothing seems to resolve.
Further Detail
This problem seems to only occur with accounts configured as auto logons which have their profiles deleted at shutdown and startup both (yes both) using the DelProf2 method.
Event Viewer Details
Event ID 1000
Faulting application name: Calculator.exe, version: 10.1812.1901.4008, time stamp: 0x5c304989 Faulting module name: Windows.UI.Xaml.dll, version: 10.0.18362.356, time stamp: 0x0825b5b0 Exception code: 0xc000027b Fault offset: 0x0000000000712cf0 Faulting process id: 0x1518 Faulting application start time: 0x01d568dbe3b0f42c Faulting application path: C:\Program Files\WindowsApps\Microsoft.WindowsCalculator_10.1812.10048.0_x64__8wekyb3d8bbwe\Calculator.exe Faulting module path: C:\Windows\System32\Windows.UI.Xaml.dll Report Id: 23d86f95-8eec-407b-b52c-86043d6d0426 Faulting package full name: Microsoft.WindowsCalculator_10.1812.10048.0_x64__8wekyb3d8bbwe Faulting package-relative application ID: App
Event ID 5961
Activation for Microsoft.WindowsCalculator_8wekyb3d8bbwe!App failed. Error code: Unknown HResult Error code: 0x80040904. Activation phase: COM App activation
Best Answer
One way to resolve this problem is to register the applicable UWP Provisioned Windows apps, and each of those applications' dependencies. Below is some PowerShell logic that is run while logged on as a user account experiencing the problem, with a login script, etc. and fixes the issue.
I confirmed that this PowerShell solution fixes this with at least two UWP apps (e.g. Calc and Photos). I figured out the PowerShell after looking over some of the logic in the Program.cs on GitHub here after confirming a run of the RegAllAppX.exe located there also resolves the problem.
The execution of that executable file on GitHub takes way too long to run, in my case at least as it needs run at every logon of the account with the problem as it gets a new profile each time it logs onto Windows 10 automatically. I think DelProf2 is not wiping the profile properly and causing the problem but a more native solution is on the back burner for now but may come in the future.
Looking over some of the logic in the Program.cs code you can research, test, and translate to equivalent PowerShell logic to perform similar operations in a more targeted and efficient manner for the specific UWP apps that experience the problem.
PowerShell
Supporting Resources
ForEach-Object
Get-AppxPackage
Add-AppxPackage
About Assignment Operators
Sort-Object