我所在的公司有一个旧的 WPF .net 4.8 桌面应用程序正在生产中运行。他们正在使用 log4net > application insights 来记录错误。错误都在那里,但有些堆栈跟踪显示...
我所在的公司有一个旧的 WPF .net 4.8 桌面应用程序正在生产中运行。他们正在使用 log4net > application insights 来记录错误。错误都在那里,但一些堆栈跟踪似乎根本没有用。我应该怎么做才能获得更好的堆栈跟踪
System.NullReferenceException:
at MS.Internal.Controls.TemplatedAdorner.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Documents.AdornerLayer.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.ScrollContentPresenter.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureCell (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureCellsGroup (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.ScrollViewer.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Border.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureCell (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureCellsGroup (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureCell (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureCellsGroup (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at MS.Internal.Helper.MeasureElementWithSingleChild (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.ScrollContentPresenter.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureCell (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureCellsGroup (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.ScrollViewer.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at MS.Internal.Helper.MeasureElementWithSingleChild (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.ContentPresenter.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Control.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at MS.Internal.Helper.MeasureElementWithSingleChild (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.ContentPresenter.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Border.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Control.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at MS.Internal.Helper.MeasureElementWithSingleChild (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.ContentPresenter.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Control.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureCell (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureCellsGroup (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at MS.Internal.Helper.MeasureElementWithSingleChild (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.ContentPresenter.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Border.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Control.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at MS.Internal.Helper.MeasureElementWithSingleChild (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.ContentPresenter.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Control.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at MS.Internal.Helper.MeasureElementWithSingleChild (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.ContentPresenter.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Border.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Control.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at MS.Internal.Helper.MeasureElementWithSingleChild (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.ContentPresenter.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Control.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureCell (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureCellsGroup (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at MS.Internal.Helper.MeasureElementWithSingleChild (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.ContentPresenter.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Border.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Control.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at MS.Internal.Helper.MeasureElementWithSingleChild (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.ContentPresenter.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Control.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Grid.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at MS.Internal.Helper.MeasureElementWithSingleChild (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.ContentPresenter.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Documents.AdornerDecorator.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Controls.Border.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Window.MeasureOverrideHelper (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Window.MeasureOverride (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.FrameworkElement.MeasureCore (PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.UIElement.Measure (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.ContextLayoutManager.UpdateLayout (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.ContextLayoutManager.UpdateLayoutCallback (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Media.MediaContext.RenderMessageHandlerCore (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Media.MediaContext.RenderMessageHandler (PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall (WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen (WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
我该怎么做才能获得更有用的堆栈跟踪,或者我应该从哪里开始调试它。我无法在 visualstudio 中重现它。是否可以使用反射来找出原始调用方法。或者将其升级到 ilogger 或使用 serilog 会有所帮助。
它不一定是由您的代码触发的。异常发生在计算要用于其中一个控件及其子控件的布局的代码中。您可以查看哪个对象为空导致异常以及原因。
我已经害怕了,它确实破坏了框架代码,但它没有告诉我触发异常的初始代码是什么。我甚至不知道它是什么类。
这 是 堆栈跟踪,因此更改日志提供程序不会影响它。
您无法在 Visual Studio 中重现它,因为它是框架代码,并且默认情况下,当调试器遇到框架异常时不会中断。您可以按照以下步骤进行配置:
https://learn.microsoft.com/en-us/visualstudio/debugger/how-to-debug-dotnet-framework-source?view=vs-2022
啊,好的,所以是在 UI 线程上。这很好(但如果是在后台线程上就更好了,因为那将是确凿的证据)