-
Notifications
You must be signed in to change notification settings - Fork 408
Description
Describe the bug
The activation arguments have a short lifetime, which makes it easy to hit errors when trying to use them. The main issue is that this includes the data in the arguments, so one has to know to copy it out instead of just keeping a reference to it.
The documentation for AppInstance.GetActivatedEventArgs mentions that
for packaged apps, this method will only return the arguments the first time it is called in an app. So, you should call it as early as possible during activation, as the arguments may become unavailable later.
but it does not mention that even if one calls it early and stores the value for later, it may also become unavailable.
For file activation, the arguments' lifetime is tied to the caller process, so GetActivatedEventArgs may not even work the first time. See #5481
For activation redirection, the activation arguments are only valid during the Activated event. So, again, it is not possible to store the arguments and use them later.
Steps to reproduce the bug
.
Expected behavior
No response
Screenshots
No response
NuGet package version
None
Packaging type
No response
Windows version
No response
IDE
No response
Additional context
No response