J'ai un WinForms lecteur MP3 application de bureau (par.NET Framework 4.7.2) qui est à l'aide de ElementHost pour accueillir un MediaElement de contrôle et dispose d'une Minuterie pour contrôler la lecture (comme la mise à jour d'un Curseur).
Tout fonctionne bien, mais lorsque je quitte l'application, j'ai l' "System.Threading.Tasks.TaskCanceledException: 'A task was canceled.'"
exception (je le remarque seulement lors de l'exécution sous le débogueur).
Ce n'est rien mais une nuisance et se sent la plupart du temps inoffensifs, mais je n'aime pas les exceptions que je ne comprends pas. La pile des appels est pas super utile:
> mscorlib.dll!System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task task) Unknown
mscorlib.dll!System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task task) Unknown
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Wait(System.TimeSpan timeout) Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherOperation operation, System.Threading.CancellationToken cancellationToken, System.TimeSpan timeout) Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.Invoke(System.Action callback, System.Windows.Threading.DispatcherPriority priority, System.Threading.CancellationToken cancellationToken, System.TimeSpan timeout) Unknown
WindowsBase.dll!MS.Internal.WeakEventTable.OnShutDown() Unknown
WindowsBase.dll!MS.Internal.WeakEventTable.WeakEventTableShutDownListener.OnShutDown(object target, object sender, System.EventArgs e) Unknown
WindowsBase.dll!MS.Internal.ShutDownListener.HandleShutDown(object sender, System.EventArgs e) Unknown
Cela se produit parce que le WPF pile n'obtient pas éliminés correctement en quelque sorte? Je m'assurer que mes DispatchTimer est arrêté dans MainForm_FormClosing mais peut-être qu'il y a autre chose j'ai besoin de nettoyer?
Pas un problème critique, bien sûr, par ennuyeux.