【问题标题】:WPF System.OutOfMemoryException System.Windows.Automation.Peers.AutomationPeer.UpdateSubtreeWPF System.OutOfMemoryException System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree
【发布时间】:2015-09-09 15:31:49
【问题描述】:

我在 .NET 框架 4.5.1 上构建了一个 WPF 桌面应用程序。它“通常”可以正常工作,但是在某些机器上,在运行时,当 WPF 数据网格将要显示时会出现 System.OutOfMemoryException。

堆栈跟踪报告:

An error of type System.OutOfMemoryException occurred.
       in System.Windows.Controls.ItemContainerGenerator.ContainerFromItem(Object item)
       in Microsoft.Windows.Controls.DataGrid.TryFindCell(Object item, DataGridColumn column)
       in Microsoft.Windows.Automation.Peers.DataGridCellItemAutomationPeer.get_OwningCellPeer()
       in Microsoft.Windows.Automation.Peers.DataGridCellItemAutomationPeer.IsEnabledCore()
       in System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
       in System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
       in System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
       in System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
       in System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
       in System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
       in System.Windows.ContextLayoutManager.fireAutomationEvents()
       in System.Windows.ContextLayoutManager.UpdateLayout()
       in System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
       in System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
       in System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
       in System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       in System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       in System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       in MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

非工作机器是 32 位、Windows 7、2 GB RAM、.NET 框架 4.5.1。

我必须说数据网格只显示几行。 我一直在网上寻找类似的错误,但找不到任何合适的解决方案。

有什么建议吗?

谢谢!

【问题讨论】:

    标签: c# .net wpf out-of-memory automationpeer


    【解决方案1】:

    问题原来是与运行帐户的某些权限缺失有关。

    当用户启动可执行文件时

    右键,以管理员身份运行

    问题消失了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-03
      • 1970-01-01
      • 2016-08-31
      • 1970-01-01
      • 1970-01-01
      • 2011-02-28
      • 1970-01-01
      相关资源
      最近更新 更多