locked
WPF程序有时出现无限弹窗,提示已添加了具有相同键的项 RRS feed

  • Question

  • 我们的WPF程序基于.NET 3.5开发,是一个零售收银程序,在部分电脑(XP和windows7)上有时会出现无限弹窗,窗口提示:已添加了具有相同键的项

    捕获的日志显示如下:

    未捕获的UI异常:    在 System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
       在 System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       在 System.Collections.Generic.Dictionary`2..ctor(IDictionary`2 dictionary, IEqualityComparer`1 comparer)
       在 Microsoft.Windows.Automation.Peers.DataGridAutomationPeer.GetItemPeers()
       在 Microsoft.Windows.Automation.Peers.DataGridAutomationPeer.GetChildrenCore()
       在 System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()
       在 System.Windows.Automation.Peers.AutomationPeer.UpdateChildren()
       在 System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
       在 System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
       在 System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
       在 System.Windows.ContextLayoutManager.fireAutomationEvents()
       在 System.Windows.ContextLayoutManager.UpdateLayout()
       在 System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
       在 System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
       在 System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
       在 System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       在 System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

     

     这个提示有时会不一样,有时提示"对 automation peer API的递归调用无效" ,有时提示"无法在正在进行内容生成时调用 StartAt",

    但基本都和System.Windows.Automation.Peers.AutomationPeer相关, 网上搜索说是和 WPFToolkit 这个组件有关,这个第三方组件我们的版本是 3.5.50211.1, 不知道其他社区朋友有没有遇到过这个问题?

    Thursday, November 15, 2018 4:02 AM

All replies

  • Hi   流云追风,

    This forum is an English forum. Please describe your problem in English. This will help other members to understand your question. 

    Please start a new thread and include all necessary code snippets for anyone else to be able to reproduce your issue from scratch along with a detailed description about the results including any exception messages

    Or you can post your question inChinese WPF forum.

    Thank your for your understanding.

    Best Regards,

    Yong Lu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Friday, November 16, 2018 3:09 AM
  • Ok,thank u
    Friday, November 16, 2018 3:50 AM