这是WPF,我正在开发一个VS2013桌面应用程序。下面是它显示的堆栈跟踪:
System.NullReferenceException
Object reference not set to an instance of an object.
at MS.Utility.FrugalStructList`1.Add(T value)
at System.Windows.Media.PointCollection.CloneCurrentValueCore(Freezable source)
at System.Windows.Freezable.CloneCoreCommon(Freezable sourceFreezable, Boolean useCurrentValue, Boolean cloneFrozenValues)
at System.Windows.Freezable.CloneCurrentValueCore(Freezable sourceFreezable)
at System.Windows.Freezable.CloneCurrentValue()
at System.Windows.Media.PathSegmentCollection.CloneCurrentValueCore(Freezable source)
at System.Windows.Freezable.CloneCoreCommon(Freezable sourceFreezable, Boolean useCurrentValue, Boolean cloneFrozenValues)
at System.Windows.Freezable.CloneCurrentValueCore(Freezable sourceFreezable)
at System.Windows.Freezable.CloneCurrentValue()
at System.Windows.Media.PathFigureCollection.CloneCurrentValueCore(Freezable source)
at System.Windows.Freezable.CloneCoreCommon(Freezable sourceFreezable, Boolean useCurrentValue, Boolean cloneFrozenValues)
at System.Windows.Freezable.CloneCurrentValueCore(Freezable sourceFreezable)
at System.Windows.Freezable.CloneCurrentValue()
at System.Windows.Media.PathGeometry.GetAsPathGeometry()
at System.Windows.Media.GeometryHitTestParameters..ctor(Geometry geometry)
at Microsoft.Expression.XamlPlatform.Views.XamlHitTestHelper.PerformHitTest(HitTestParameters hitTestParameters, HitTestModifier hitTestModifier, InvisibleObjectHitTestModifier invisibleObjectHitTestModifier, ICollection`1 ignoredElements, Boolean stopAfterFirstHit, Boolean skipFullyContainedSelectionInObject, ViewHitTestFilterCallback filterCallback)
at Microsoft.Expression.XamlPlatform.Views.XamlSceneView.GetElementsInRectangle(Rect rectangle, HitTestModifier hitTestModifier, InvisibleObjectHitTestModifier invisibleObjectHitTestModifier, Boolean skipFullyContainedSelectionInObject)
at Microsoft.Expression.XamlPlatform.Views.XamlSceneView.HitElementHelper.GetSelectableElementsInRectangle(Rect rectangle)
at Microsoft.Expression.XamlPlatform.Views.XamlSceneView.GetSelectableElementAtPoint(Point point, SelectionFor3D selectionFor3D, Boolean selectedOnly, Boolean smartInvisiblePanelSelect)
at Microsoft.Expression.DesignSurface.View.SceneView.GetCachedSelectableElementAtPoint(Point point, SelectionFor3D selectionFor3D)
at Microsoft.Expression.DesignSurface.Tools.Selection.ElementEditorBehavior.OnHoverOverNonAdorner(Point pointerPosition)
at Microsoft.Expression.DesignSurface.Tools.ElementToolBehavior.OnHover(Point pointerPosition)
at Microsoft.Expression.DesignSurface.Tools.EventRouter.ScopeElement_MouseMove_Internal(MouseEventArgs args)
at Microsoft.Expression.DesignSurface.Tools.EventRouter.ThrottledEventHandler`1.HandleEventNow()
at Microsoft.Expression.DesignSurface.Tools.EventRouter.ThrottledEventHandler`1.ScheduleEventHandling(Args args, Double interval)
at Microsoft.Expression.DesignSurface.Tools.EventRouter.ScopeElement_MouseMove(Object sender, MouseEventArgs args)
at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at Microsoft.Expression.DesignHost.Isolation.DesignerProcess.RunApplication()
at Microsoft.Expression.DesignHost.Isolation.DesignerProcess.<>c__DisplayClass2.<Main>b__0()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()我使用this SO post的帮助附加了另一个Visual Studio实例,它在异常时中断,但整个调用堆栈都是外部代码,我看不出有什么问题。还有人碰到过这个吗?这是我能解决的问题吗?
发布于 2015-07-12 09:30:20
提示是FrugalStructList。在研究这个问题时,其他空引用异常是由于样式问题而发生的。
缩小问题范围的攻击计划
if (!DesignerProperties.IsInDesignModeProperty)。https://stackoverflow.com/questions/31360761
复制相似问题