Maui: [Bug] Snackbar does not show on windows when referencing the nuget package
Description
I tried using DisplaySnackbar()
in my project and while I got no errors, the notification did not display when debugging on windows.
I then created a brand new project from the latest preview 10 templates, added a reference to the toolkit, and updated the OnCounterClicked
method to show a snackbar like so:
private async void OnCounterClicked(object sender, EventArgs e)
{
await this.DisplaySnackbar("TEST");
count++;
CounterLabel.Text = $"Current count: {count}";
SemanticScreenReader.Announce(CounterLabel.Text);
}
This still does not show a notification.
I then cloned the repo and added a direct reference to the project so I could step through what was going wrong, however, this time the notification displayed as expected.
Stack Trace
N/A
Steps to Reproduce
- create new project from maui preview 10 templates
- reference pre3 nuget
- attempt to display a Snackbar
Expected Behavior
Notification displays in windows
Actual Behavior
nothing happens on windows
Basic Information
- Version with issue: pre3
- Last known good version: N/A
- IDE: Visual studio
- Platform Target Frameworks:
- UWP: same as preview 10 template
- Nuget Packages: same as preview 10 template
- Affected Devices: windows
Workaround
clone the repo and reference the project directly
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (2 by maintainers)
@VladislavAntonyuk yep that works fine.
@pictos this repros the issue on my machine: https://github.com/CodedBeard/notoast
If I only update the nuget reference to be a project reference from cloning the repo, it works fine.