I have made a winforms app and changed the target framework to net5.0-windows10.0.19041.0. This gives me access to Windows.UI.Notifications. I use this to make a badge notification with the following C# code:
var xmlText = "<badge value="alert"/>";
var xmlDoc = new Windows.Data.Xml.Dom.XmlDocument();
xmlDoc.LoadXml(xmlText);
var badgeNotification = new Windows.UI.Notifications.BadgeNotification(xmlDoc);
var bu = Windows.UI.Notifications.BadgeUpdateManager.CreateBadgeUpdaterForApplication();
bu.Update(badgeNotification);
This correctly shows a badge in the start menu when the packaged app is run, but not in the task bar, on my Windows 10 computer. When a second window is opened in the app, the badge shows up in the task bar, but when the second window is closed again, the badge disappears. Is this intended behavior? If so, how can I show a badge in the task bar for a packaged winforms app?