Protocol Activation - Unpackaged App: Microsoft.Windows.AppLifecycle.AppInstance.GetActivatedEventArgs() returns object with Data as WinRT.IInspectable #9225
Labels
bug
Something isn't working
Describe the bug
Attempting to get single instancing working via protocol activation in a Self Contained Unpackaged app.
When attempting to retrieve AppActivationArguments during app startup using GetActivatedEventArgs() method on the current AppInstance returns an AppActivationArguments object where the Data property is returned as a WinRT.IInspectable object. The returned WinRT.IInspectable is unusable and attempting to resolve it always results in protected memory access exceptions.
Steps to reproduce the bug
Create a new WinUI3 Unpackaged project.
Implement the single instancing pattern by overriding the generated program.cs and attempt to retrieve the AppActivationArguments by calling Microsoft.Windows.AppLifecycle.AppInstance.GetCurrent().GetActivatedEventArgs() when the app is started.
Inspect the Data property of the AppActivationArguments object.
Expected behavior
The AppActivationArguments Data property should be set to the appropriate IActivatedEventArgs implementation based on the launch type (Launch, Protocol, etc.) as it is when building and running a Packaged app.
Screenshots
NuGet package version
WinUI 3 - Windows App SDK 1.4.3: 1.4.231115000
Windows version
Windows 11 (22H2): Build 22621
Additional context
No response
The text was updated successfully, but these errors were encountered: