gpt4 book ai didi

.net - Debug.Fail 给我一个 "Dispatcher processing has been suspended"错误

转载 作者:行者123 更新时间:2023-12-02 00:28:18 26 4
gpt4 key购买 nike

我在导致调用 Debug.Fail 的代码中遇到问题。我经常使用 Debug.Assert 和 Debug.Fail,因为它不仅会即时通知我存在问题,还会提供有关问题所在和位置的信息。

但这次 Debug.Fail 本身导致了一个更大的问题,因为 UI (WPF) 因以下错误而卡住:

Dispatcher processing has been suspended, but messages are still being processed.

我能做些什么来使 Debug.Fail 成功吗?我绝对不希望 Debug.Fail 周围有代码来检查是 Invoke 还是 BeginInvoke。

编辑:我想更换 DefaultTraceListener 会成功吗?

最佳答案

看起来您是 DependencyProperty 更改回调的 Debug.Fail。

您可以在这里找到完整的答案:'Dispatcher processing has been suspended' InvalidOperationException when calling ShowDialog

关于.net - Debug.Fail 给我一个 "Dispatcher processing has been suspended"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7955151/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com