-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory error reading bug when using ContextMenuMode="SecondWindow" for tray icons in Windows AppSdk 1.4.230822000 version #107
Comments
Sorry, I now have time issues and don’t have access to a Windows machine. I had problems running WinUI on a virtual machine inside Parallels Desktop arm64 |
It would be great if someone took the time to check if rolling back to one of the previous versions of WindowsAppSDK helps |
1.3 works. We got some other issue with 1.3 so it would've been nice if this worked, but that's life. I tried the popup message mode, but it seems that the click events aren't being triggered? Do you have a clue on that? The active window mode works, but it renders behind the system tray blob. |
In the latest package version, I found that this issue still occurs in the debugging mode of Visual Studio 2022, but I tried to run it directly without debugging and found that it also has issues. |
Same problem here, the application crashes in debugging mode after upgrading the WindowsAppSDK to 1.4. It worked fine with 1.3. |
Please try to disable In app toolbar in VS |
The temporary solution is to build the ContextFlyout programmatically and not assign it to the TrayIcon control. var menuFlyout = new MenuFlyout();
var showHideWinCmd = new XamlUICommand()
{
Label = TranslateUtils.Translate("menu_show_hide_window"),
Description = TranslateUtils.Translate("menu_show_hide_window"),
IconSource = new SymbolIconSource() { Symbol = Symbol.OpenPane },
};
showHideWinCmd.ExecuteRequested += ShowHideWindowCommand_ExecuteRequested;
menuFlyout.Items.Add(new MenuFlyoutItem()
{
Command = showHideWinCmd
});
var exitAppCmd = new XamlUICommand()
{
Label = TranslateUtils.Translate("menu_exit_application"),
Description = TranslateUtils.Translate("menu_exit_application"),
IconSource = new SymbolIconSource() { Symbol = Symbol.ClosePane },
};
showHideWinCmd.ExecuteRequested += ExitApplicationCommand_ExecuteRequested;
menuFlyout.Items.Add(new MenuFlyoutItem()
{
Command = exitAppCmd
});
TrayIcon.LeftClickCommand = showHideWinCmd;
#if !DEBUG
TrayIcon.ContextFlyout = menuFlyout;
#endif |
Describe the bug
Error: Exception thrown at 0x00007FFDC50BDE84 (Microsoft. UI. Windowing. Core. dll) (located in App1. exe): 0xC000000 5: An access violation occurred while reading position 0x0000000000030.
Steps to reproduce the bug
In WIndowsAppSdk (v1.4.230822000), use the TaskbarIcon of H.NotifyIcon. WinUI (v2.0.116) to create a tray icon, then set ContextMenuMode="SecondWindow", and finally trigger Exception throw at 0x00007FFDC50BDE84 (Microsoft. UI. Windowing. Core. dll) (located in App. WinUI3 Exe): 0xC000000 5: An access Violation occurred while reading position 0x000000000030
Expected behavior
Should be created correctly and functioning properly
Screenshots
No response
NuGet package version
WindowsAppSdk (1.4.230822000)
H.NotifyIcon(2.0.116)
Platform
WinUI
IDE
Visual Studio 2022-preview
Windows Version
Windows 11
WindowsAppSDK Version
Other
WindowsAppSDK Type
None
Manifest
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: