I have added a Systray extension to my UWP project using this guide: https://stefanwick.com/2017/06/24/uwp-app-with-systray-extension/
The app can run in Debug and Release mode without issue, but after I package the app (.appxupload) and then upload it to the Microsoft Store, I then download it and install it, but it crashes immediately upon launch.
In Visual Studio, I go to Debug > Other Debug Targets > Debug Installed App Package..., and when I debug the app it only shows this error:
Activation of the Windows Store app 'MyApp!App' failed with error 'The target process aborted before activation completed. More information may be available in the Debug pane of the Output window (Debug->Windows->Output)'.
Activation of the Windows Store app 'MyApp!App' failed with error 'The app didn't start'.
Windows EventViewer just shows this:
Faulting module name: KERNELBASE.dll, version: 10.0.22621.1555, time stamp: 0x235a45d0
Exception code: 0xe0434352
As the app is not executing any of my code, it is difficult to find the source of this problem. When the following code is removed from the Package.appxmanifest file, and then it is uploaded to the Microsoft store, it can be downloaded and installed successfully:
<Extensions>
...
<uap:Extension Category="windows.appService">
<uap:AppService Name="MyUWPExtensionService" />
</uap:Extension>
<desktop:Extension Category="windows.fullTrustProcess" Executable="Win32\SystemTrayComponent.exe" />
</Extensions>
...
<Capabilities>
<rescap:Capability Name="runFullTrust" />
<rescap:Capability Name="confirmAppClose" />
...
</Capabilities>