Skip to content

AppInstance.GetCurrent().GetActivatedEventArgs().Data returns "null" on command line activation #3275

@myblindy

Description

@myblindy

Describe the bug

I enabled app execution aliasing to get the project to be callable from the command line (for jump lists), and that part works fine.

However sending command line arguments don't seem to be caught by the child app with a AppInstance.GetCurrent().GetActivatedEventArgs(). In fact, the Data property is "null" (quoted, because it's not actually null, it's some allocated IInspectable with nothing else inside and I'm assuming that's what a null looks like in WinRT).

I'm receiving the same "null" value both by launching it from VS the first time and from the jump list as a child process.

Steps to reproduce the bug

  1. Clone https://github.com/myblindy/EasyDownloader2/tree/feature/jumplists
  2. Run the application in debug mode, the main window should appear as normal (however in Program.DecideRedirection the activated data is already "null").
  3. From the jump list on the task bar, click the custom entry:
    image
  4. The second application starts, sends a redirect command (with "null" data, since that's what it can see) which is then correctly caught by the main application and then ignored as unhandled.

Expected behavior

For step 2, I should see an actual Data property with an empty string for command line arguments. For step 4, I should see the correct command line arguments as well. Note that the arguments are caught correctly by the Main function itself, but I am unable to construct my own object with it to send to the main application.

Screenshots

No response

NuGet package version

Windows App SDK 1.2.1: 1.2.221116.1

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022-preview

Additional context

No response

Metadata

Metadata

Assignees

Labels

area-ActivationApp activation in Windows App SDK via AppLifecycle for packaged & unpackaged appsbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions