ToastNotifier.GetScheduledToastNotifications() throws "Element not found" (Exception from HRESULT: 0x80070490)

8

I've noticed in my telemetry data that the following code sometimes results in an exception "System.Exception: Element not found. (Exception from HRESULT: 0x80070490)"

var notifier = ToastNotificationManager.CreateToastNotifier();
var notifications = notifier.GetScheduledToastNotifications();

The code is run inside a Windows Phone 8.1 (WinPRT) application on a background thread and the exception is thrown quite sparsely.

Any ideas what might be causing this or additional information I can provide?

windows-runtime
windows-phone-8.1
asked on Stack Overflow Mar 28, 2015 by Jan Kratochvil

2 Answers

12

I had the same problem.

It took a long time to figure out, but it's a really easy fix :

"The exception is because you need to provide an applicationId in CreateToastNotifier()"

( Windows 10: Showing a toast Notification )

answered on Stack Overflow Feb 25, 2016 by MGamsby • edited May 23, 2017 by Community
0

Maybe late to the party, but in my case it was caused by the fact that I was removing some scheduled toasts in another thread at that moment.

answered on Stack Overflow Jun 21, 2016 by Viktor Szekeress

User contributions licensed under CC BY-SA 3.0