Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/13.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
C# InvalidOperationException导致Visual Studio中断,即使在用C代码处理时也是如此_C#_Wpf_Visual Studio_Exception Handling - Fatal编程技术网

C# InvalidOperationException导致Visual Studio中断,即使在用C代码处理时也是如此

C# InvalidOperationException导致Visual Studio中断,即使在用C代码处理时也是如此,c#,wpf,visual-studio,exception-handling,C#,Wpf,Visual Studio,Exception Handling,在我的C#应用程序中,我捕获类型为SystemException的异常,但当引发异常时,Visual Studio 2015会中断: 正如您在上面的屏幕截图中所看到的,我有意在初始化某些对象之前提前释放一个ISupportInitialize锁。我正在等待异常,并且有一个catch块 此外,我感兴趣的异常没有列在异常设置窗口中;i、 e.未检查它们是否进入中断模式 尽管对话框显示“抛出此异常时中断”未选中,但应用程序仍进入中断模式。 编辑: SLaks请求的堆栈跟踪: Presentati

在我的C#应用程序中,我捕获类型为
SystemException
的异常,但当引发异常时,Visual Studio 2015会中断:

正如您在上面的屏幕截图中所看到的,我有意在初始化某些对象之前提前释放一个
ISupportInitialize
锁。我正在等待异常,并且有一个catch块

此外,我感兴趣的异常没有列在异常设置窗口中;i、 e.未检查它们是否进入中断模式

尽管对话框显示“抛出此异常时中断”未选中,但应用程序仍进入中断模式。

编辑:

SLaks请求的堆栈跟踪:

PresentationCore.dll!System.Windows.Media.GlyphRun.CheckInitialized()未知 PresentationCore.dll!System.Windows.Media.GlyphRun.ComputeInkBoundingBox()未知 PresentationCore.dll!System.Windows.Media.BoundsDrawingContextWalker.DrawGlyphRun(System.Windows.Media.Brush foregroundBrush,System.Windows.Media.GlyphRun GlyphRun)未知 PresentationCore.dll!System.Windows.Media.RenderData.DrawingContextWalk(System.Windows.Media.DrawingContextWalker ctx)未知 PresentationCore.dll!System.Windows.Media.RenderData.GetContentBounds(System.Windows.Media.BoundsDrawingContextWalker ctx)未知 PresentationCore.dll!System.Windows.UIElement.GetHitTestBounds()未知 PresentationCore.dll!System.Windows.Media.Visual.PreComputerContent()未知 PresentationCore.dll!System.Windows.Media.Visual.PrecomputerRecursive(out System.Windows.Rect bboxSubgraph)未知 PresentationCore.dll!System.Windows.Media.Visual.PrecomputerRecursive(out System.Windows.Rect bboxSubgraph)未知 PresentationCore.dll!System.Windows.Media.Visual.PrecomputerRecursive(out System.Windows.Rect bboxSubgraph)未知 PresentationCore.dll!System.Windows.Media.Visual.PrecomputerRecursive(out System.Windows.Rect bboxSubgraph)未知 PresentationCore.dll!System.Windows.Media.Visual.PrecomputerRecursive(out System.Windows.Rect bboxSubgraph)未知 PresentationCore.dll!System.Windows.Media.Visual.PrecomputerRecursive(out System.Windows.Rect bboxSubgraph)未知 PresentationCore.dll!System.Windows.Media.Visual.PrecomputerRecursive(out System.Windows.Rect bboxSubgraph)未知 PresentationCore.dll!System.Windows.Media.Visual.Precompute()未知 PresentationCore.dll!System.Windows.Media.CompositionTarget.System.Windows.Media.ICompositionTarget.Render(布尔inResize,System.Windows.Media.Composition.DUCE.Channel)未知 PresentationCore.dll!System.Windows.Media.MediaContext.Render(System.Windows.Media.ICompositionTarget resizedCompositionTarget)未知 PresentationCore.dll!System.Windows.Media.MediaContext.RenderMessageHandlerCore(对象大小调整的CompositionTarget)未知 PresentationCore.dll!System.Windows.Media.MediaContext.RenderMessageHandler(对象大小调整的CompositionTarget)未知 WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate回调,对象args,int numArgs)未知 WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(对象源、System.Delegate回调、对象args、int numArgs、System.Delegate catchHandler)未知 WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl()未知 WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(对象状态)未知 mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext ExecutionContext,System.Threading.ContextCallback回调,对象状态,bool preserveSyncCtx)未知 mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext ExecutionContext,System.Threading.ContextCallback回调,对象状态,bool preserveSyncCtx)未知 mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext ExecutionContext,System.Threading.ContextCallback回调,对象状态)未知 WindowsBase.dll!MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext executionContext,System.Threading.ContextCallback回调,对象状态)未知 WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Invoke()未知 WindowsBase.dll!System.Windows.Threading.Dispatcher.ProcessQueue()未知 WindowsBase.dll!System.Windows.Threading.Dispatcher.WndProcHook(System.IntPtr hwnd,int msg,System.IntPtr wParam,System.IntPtr lParam,ref bool handled)未知 WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd,int msg,System.IntPtr wParam,System.IntPtr lParam,ref bool handled)未知 WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(对象o)未知 WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate回调,对象args,int numArgs)未知 WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(对象源、System.Delegate回调、对象args、int numArgs、System.Delegate catchHandler)未知 WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority,System.TimeSpan超时,System.Delegate方法,对象args,int numArgs)未知 WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd,int msg,System.IntPtr wParam,System.IntPtr lParam)未知 [本机到托管转换]
[管理到本机转换]
WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)未知 WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)未知 陈述
DispatcherUnhandledException += (sender, args) =>
            {
                Console.WriteLine("Wild exception appeared!!!");
            };