microsoft / microsoft/WindowsAppSDK

From AppExecutionAlias startup, AppInstance.GetActivatedEventArgs returns null

Open
#5,006 3 comments 0 reactions 0 assignees View on GitHub
area-Lifecycle
Dominant language
C++
Stars
4.7k
Forks
471
Avg merge
3d 13h
Merged PRs (30d)
28

Description

### Describe the bug

From AppExecutionAlias startup, AppInstance.GetActivatedEventArgs returns null

##### ----------------------------

从 AppExecutionAlias 启动时,AppInstance.GetActivatedEventArgs 返回 null

### Steps to reproduce the bug

1. Create the desktop bridge application and add AppExecutionAlias support to the application list.
2. Input the application name using CMD or PowerShell start the application, the application of the entry point method (the Main method) to obtain AppInstance. GetActivatedEventArgs, actually returns null

##### ----------------------------

1.创建桌面桥应用程序,并在应用清单添加应用启动别名支持(AppExecutionAlias)
2.使用 CMD 或 PowerShell 输入应用程序名称启动应用,在应用的入口点方法(Main 方法)获取 AppInstance.GetActivatedEventArgs,实际上返回的是 null

### Expected behavior

Will return like UWP application, start type for CommandLaunch or Launch, with CommandLaunchActivatedEventArgs or LaunchActivatedEventArgs boot parameters

##### --------------------------------------------

能够像 UWP 应用一样,返回启动类型为 CommandLaunch 或 Launch,带有 CommandLaunchActivatedEventArgs 或 LaunchActivatedEventArgs 的启动参数

### Screenshots

Application manifest defines the application entry (application alias - AppExecutionAlias)

##### --------------------------------------------

应用清单定义应用入口(应用程序别名—— AppExecutionAlias)
![Image](https://github.com/user-attachments/assets/17ed6fba-15f2-4464-9ebe-e46dd4b7f328)

--------------------------------------------

Launch the application from the console
##### --------------------------------------------

--------------------------------------------

从控制台启动应用程序
![Image](https://github.com/user-attachments/assets/20ba6314-73f2-4af6-b05a-c32e9b79d190)

The Main method gets the application startup type and startup parameters, and returns null

##### --------------------------------------------

Main 方法获取应用程序启动类型和启动参数,结果返回 null
![Image](https://github.com/user-attachments/assets/12048096-7445-454c-ab62-b16732d9313b)
![Image](https://github.com/user-attachments/assets/290ed7ac-3e89-420a-b7eb-efe8a0e76f28)

### NuGet package version

Windows App SDK 1.6.3: 1.6.241114003

### Packaging type

Packaged (MSIX)

### Windows version

Insider Build (xxxxx), Windows 11 version 22H2 (22621, 2022 Update), Windows 11 version 21H2 (22000), Windows 10 version 21H2 (19044, November 2021 Update), Windows 10 version 22H2 (19045, 2022 Update), Windows 10 version 21H1 (19043, May 2021 Update), Windows 10 version 20H2 (19042, October 2020 Update), Windows 10 version 2004 (19041, May 2020 Update), Windows 10 version 1909 (18363, November 2019 Update), Windows 10 version 1903 (18362, May 2019 Update), Windows 10 version 1809 (17763, October 2018 Update)

### IDE

Visual Studio 2022

### Additional context

This problem exists in all current versions of Windows

##### --------------------------------------------

这个问题存在当前所有的 Windows 版本中

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the packaged MSIX scenario: launch through the AppExecutionAlias from CMD or PowerShell, then inspect AppInstance.GetActivatedEventArgs in the Main entry point. Compare the observed result with the expected CommandLaunch or Launch activation arguments; done means the API returns the appropriate activation data instead of null.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.