Skip to content

[WinUI3 windowless] Crashes when TaskbarIcon is the only element in ResourceDictionary #196

@koharubiyori

Description

@koharubiyori

Describe the bug

Based on WinUI - Windowless, the message when exiting: xxx.exe has exited with code 3221226525 (0xc000041d).

TrayIcon.xaml:

<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:tb="using:H.NotifyIcon"
>
	<tb:TaskbarIcon
        x:Key="TrayIcon"
        x:Uid="TrayIcon"
        Visibility="Visible"
        MenuActivation="LeftOrRightClick"
        ContextMenuMode="SecondWindow"
        NoLeftClickDelay="True"
        >
		<tb:TaskbarIcon.ContextFlyout>
			<MenuFlyout>
				<ToggleMenuFlyoutItem x:Uid="StartupSwitch" x:Name="StartupSwitch" />
				<ToggleMenuFlyoutItem x:Uid="LanOnlySwitch" x:Name="LanOnlySwitch" />
				<MenuFlyoutItem x:Uid="ExitButton" x:Name="ExitButton" />
			</MenuFlyout>
		</tb:TaskbarIcon.ContextFlyout>
	</tb:TaskbarIcon>
</ResourceDictionary>

Steps to reproduce the bug

No response

Expected behavior

No response

Screenshots

No response

NuGet package version

2.2.0

Platform

WinUI

IDE

Visual Studio 2022

Windows Version

Windows 11

WindowsAppSDK Version

Other

WindowsAppSDK Type

Unpackaged

Manifest

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions