Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Silverlight MessageBox.Show调试时在异步方法内不显示_Silverlight - Fatal编程技术网

Silverlight MessageBox.Show调试时在异步方法内不显示

Silverlight MessageBox.Show调试时在异步方法内不显示,silverlight,Silverlight,在调试一个应用程序时,我遇到了MessageBox.Show不显示的一些奇怪行为。要复制,请使用以下命令并运行它 它将按预期工作,显示MessageBox 现在在DoSomething中放置一个断点并运行。消息框将不会显示 现在删除async关键字,它将再次正常工作 这是怎么回事?我有一个应用程序,可以执行常见的确认对话框,但在调试过程中被跳过。我最终找到了async关键字,但这对我来说没有任何意义,无法解释为什么会发生这种情况。可能是调试器中的错误 private void ButtonBas

在调试一个应用程序时,我遇到了MessageBox.Show不显示的一些奇怪行为。要复制,请使用以下命令并运行它

它将按预期工作,显示MessageBox

现在在DoSomething中放置一个断点并运行。消息框将不会显示

现在删除async关键字,它将再次正常工作

这是怎么回事?我有一个应用程序,可以执行常见的确认对话框,但在调试过程中被跳过。我最终找到了async关键字,但这对我来说没有任何意义,无法解释为什么会发生这种情况。可能是调试器中的错误

private void ButtonBase_OnClick(object sender, RoutedEventArgs e) {
       DoSomething();
    }

    public async void DoSomething() {
        MessageBox.Show("Starting");
        ShowMessageBox();
        MessageBox.Show("In DoSomething()");


    }

    public void ShowMessageBox() {
        MessageBox.Show("In ShowMessageBox");
    }

这似乎是Visual Studio的一个问题

异步方法的已完成事件在哪里?