使用AvalonDock 2.0时未处理的’System.ComponentModel.Win32Exception’

我正在使用AvalonDock 2.0 ,当我打开一个dock容器时,在调试模式下应用程序崩溃(它在没有调试的情况下运行时工作正常)。 我得到以下exception:

WindowsBase.dll中出现未处理的“System.ComponentModel.Win32Exception”类型exception

附加信息:操作成功完成

我遇到了这个答案 ,建议取消选中“例外设置”中的框。 有线的事情是它第一次使用它。 但它不再存在了。 我试过其他机器也不行。 任何有关如何解决此问题的建议。
Avalon代码(第5行引发的exception)

protected override IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { if (msg == Win32Helper.WM_WINDOWPOSCHANGING) { if (_internalHost_ContentRendered) { // the below line throw the exception Win32Helper.SetWindowPos(_internalHwndSource.Handle, Win32Helper.HWND_TOP, 0, 0, 0, 0, Win32Helper.SetWindowPosFlags.IgnoreMove | Win32Helper.SetWindowPosFlags.IgnoreResize); } } return base.WndProc(hwnd, msg, wParam, lParam, ref handled); } 

显然存在一个问题 ,但直到现在才有回应。

因此,作为一种解决方法,我使用App.xaml.cs Application.DispatcherUnhandledException处理了任何未处理的exception。
请查看此答案以获取更多详细信息。
码:

 protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); this.DispatcherUnhandledException += AppGlobalDispatcherUnhandledException; } private void AppGlobalDispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { e.Handled = true; } 

对于登陆此页面的任何其他人,我可以在关闭以下设置的情况下解决问题:

工具>选项>调试>常规>为XAML启用UI调试工具

我的快速黑客是我在调试配置期间禁用了LayoutAutoHideWindowControl类中的UpdateWindowPos()。

  internal void Show(LayoutAnchorControl anchor) { if (_model != null) throw new InvalidOperationException(); _anchor = anchor; _model = anchor.Model as LayoutAnchorable; _side = (anchor.Model.Parent.Parent as LayoutAnchorSide).Side; _manager = _model.Root.Manager; CreateInternalGrid(); _model.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_model_PropertyChanged); Visibility = System.Windows.Visibility.Visible; InvalidateMeasure(); #if !DEBUG UpdateWindowPos(); #endif Trace.WriteLine("LayoutAutoHideWindowControl.Show()"); } 

根据我目前的经验,这只会导致无法拖放最小化的可停靠容器。