```PackageCatalog.PackageUpdating``` event cause app exit abnormally(The API was called internally by WinGet package manager)
Relevant area(s)
WinGet CLI
Relevant command(s)
No response
Brief description of your issue
PackageCatalog.PackageUpdating event cause app exit abnormally
--------------------------
PackageCatalog.PackageUpdating 事件导致应用退出异常(WinGet package manager 内部调用了该 API)
https://github.com/microsoft/winget-cli/blob/0d5b16ba7b5dc058f291f87a33c572d30e86ef85/src/AppInstallerCLICore/ShutdownMonitoring.cpp#L83
https://github.com/microsoft/winget-cli/commit/e6b1d025daaa9ccf22db4bc9fbb13c2ecc761166
As mentioned above, WinGet in version 1.12 calls the PackageCatalog.PackageUpdating apis, this API will lead to the application behavior when exit application, as shown in the following image and video
--------------------------
https://github.com/microsoft/winget-cli/blob/0d5b16ba7b5dc058f291f87a33c572d30e86ef85/src/AppInstallerCLICore/ShutdownMonitoring.cpp#L83
https://github.com/microsoft/winget-cli/commit/e6b1d025daaa9ccf22db4bc9fbb13c2ecc761166
如上所述,WinGet 在 1.12 版本中调用了 PackageCatalog.PackageUpdating API,该 API 会导致应用程序在退出应用时行为异常,如下图和视频所示
Steps to reproduce
- Create a blank WinUI 3 application
- Mount
PackageCatalog.PackageUpdatingevents - Exit the application
- Observe the performance of the corresponding process in the Task Manager (or mount the Visual Studio debugger to view)
--------------------------
- 创建一个空白 WinUI 3 应用
- 挂载
PackageCatalog.PackageUpdating事件 - 退出应用
- 看任务管理器对应进程的表现(或挂载 Visual Studio 调试器查看)
Expected behavior
PackageCatalog.PackageUpdating event, application can exit out of normal process will not trigger the exception
--------------------------
挂载 PackageCatalog.PackageUpdating 事件后,应用退出能正常退出进程,不会触发异常
Actual behavior
https://github.com/user-attachments/assets/d6ae9a95-44ca-422d-9e15-47b944c3842c
https://learn.microsoft.com/uwp/api/windows.applicationmodel.packagecatalog.packageupdating?view=winrt-26100
Environment
Windows Package Manager 1.27.420.0
Windows 11 26100.7070
The following issues might be duplicates:
- #5869
- #5870
AI-generated content by genai-issue-dedup may be incorrect.