Outlook add-in VSTO project cannot override App logo when sending local notification, ends up without text or logo when using .AddAppLogoOverride()
private void CallNotification()
{
CreateToastNotification("This is test header", "First line of notification", "...second line...");
}
public void CreateToastNotification(string title, string message, string message2)
{
ToastContent content = new ToastContentBuilder()
.AddText(title)
.AddText(message)
.AddText(message2)
.AddAppLogoOverride(new Uri("/component/logo.png", UriKind.Relative), ToastGenericAppLogoCrop.Circle)
.AddAttributionText("My notification service")
.AddButton(new ToastButton()
.SetContent("Open Google")
.AddArgument("url", "https://google.com"))
.AddButton(new ToastButton()
.SetContent("Dismiss")
.AddArgument("dismiss", "dismiss"))
.SetToastDuration(ToastDuration.Long)
.GetToastContent();
// Creates the notification
ToastNotification notification = new ToastNotification(content.GetXml());
//set expiration poilicies
notification.ExpirationTime = DateTime.Now.AddMinutes(120);
//add handlers
notification.Activated += ToastNotificationCallback_Activated;
notification.Dismissed += Notification_Dismissed;
notification.Failed += Notification_Failed;
//Adds toast notification to list to persist toast
toastNotificationList.Add(notification);
//Sends the notification
//do not forget to add APPID to CreateToastNotifier()
//https://stackoverflow.com/questions/32214716/showing-a-windows-10-toast-notification
ToastNotificationManager.CreateToastNotifier("MyAppID").Show(notification);
}
My logo.png exists and is copied to output dir
And result is generic notification without passed text or icon
When I comment .AddAppLogoOverride()
shows text, but without logo.
Any idea what could be wrong? Maybe Uri?