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?

Jan Kratochvil
  • 2,307
  • 1
  • 21
  • 39

2 Answers2

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 )

Community
  • 1
  • 1
MGamsby
  • 386
  • 4
  • 13
1

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.

Viktor Szekeress
  • 175
  • 1
  • 13