.net ';DispatcherUnandledException';找不到?

.net ';DispatcherUnandledException';找不到?,.net,xaml,win-universal-app,windows-10-universal,.net,Xaml,Win Universal App,Windows 10 Universal,我目前遇到一个有关DispatcherUnhandledException的问题。我已经和谷歌联系过了,但似乎没有其他人有这个问题 问题是,当我尝试使用App.xaml中的Dispatcher时,Visual Studio会抛出错误消息。我的代码如下所示: <Application x:Class="TaskTree_Universal.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation

我目前遇到一个有关
DispatcherUnhandledException
的问题。我已经和谷歌联系过了,但似乎没有其他人有这个问题

问题是,当我尝试使用App.xaml中的Dispatcher时,Visual Studio会抛出错误消息。我的代码如下所示:

<Application
    x:Class="TaskTree_Universal.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:TaskTree_Universal"
    DispatcherUnhandledException="App_DispatcherUnhandledException"
    <!--The above line causes the problem-->
    RequestedTheme="Light">
</Application>

在UWP应用程序中,您将为事件添加处理程序,而不是WPF中的事件:

<Application ...
    UnhandledException="Application_UnhandledException"
    RequestedTheme="Light">
</Application>

我读到了未处理的事件,但我认为它们是不同的。谢谢你把这件事弄清楚!