locked
An item with the same key has already been added. RRS feed

  • Question

  • I have some XAML:

          <ObjectDataProvider x:Key="CandidateLists" 
                        ObjectType="{x:Type svc:CandidateService}" 
                        MethodName="GetCandidateList"></ObjectDataProvider>
    
    

    And VS show a squiggly blue line. When I hover over the text I see the error: "An item with the same key has already been added". When I compile I get the same error. Any ideas on how I might track this down?

    Thank you.

    Kevin

     


    Kevin Burton
    Tuesday, November 23, 2010 4:36 PM

Answers

  • Hi Kevin,

    I assume you did a search for x:Key="CandidateLists" within the scope of your ODP (i.e. a Window or even your whole project) ..?


    Cheers,
    Olaf
    http://blogs.intuidev.com
    • Proposed as answer by Jarrey Wednesday, November 24, 2010 2:39 PM
    • Marked as answer by Jie Bao Thursday, November 25, 2010 1:35 AM
    Tuesday, November 23, 2010 4:48 PM
  • Hi Kevin,

    Olaf is right, you should search the whole project or the current window by the key work "CandidateLists" carefully. Hope you could find the cause.

    Sincerely,
    Bob Bao

    MSDN Subscriber Support in Forum 

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Are you looking for a typical code sample? Please download All in One Code Framework !

    如果有回复帮助并解决了您的问题,请点击 “标记为答复”,如果没有没有帮助,请随时点击“取消答复标记”
    你在为寻找代码示例而苦恼吗?赶快来下载 All in One Code Framework 微软一站式代码框架 吧!
    • Marked as answer by KevinBurton Wednesday, November 24, 2010 2:28 PM
    Wednesday, November 24, 2010 11:18 AM

All replies

  • Hi Kevin,

    I assume you did a search for x:Key="CandidateLists" within the scope of your ODP (i.e. a Window or even your whole project) ..?


    Cheers,
    Olaf
    http://blogs.intuidev.com
    • Proposed as answer by Jarrey Wednesday, November 24, 2010 2:39 PM
    • Marked as answer by Jie Bao Thursday, November 25, 2010 1:35 AM
    Tuesday, November 23, 2010 4:48 PM
  • Hi Kevin,

    Olaf is right, you should search the whole project or the current window by the key work "CandidateLists" carefully. Hope you could find the cause.

    Sincerely,
    Bob Bao

    MSDN Subscriber Support in Forum 

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Are you looking for a typical code sample? Please download All in One Code Framework !

    如果有回复帮助并解决了您的问题,请点击 “标记为答复”,如果没有没有帮助,请随时点击“取消答复标记”
    你在为寻找代码示例而苦恼吗?赶快来下载 All in One Code Framework 微软一站式代码框架 吧!
    • Marked as answer by KevinBurton Wednesday, November 24, 2010 2:28 PM
    Wednesday, November 24, 2010 11:18 AM
  • I didn't find it. I think the problem was due to a temporary dictionary insert error on initialization. It was hard to not focus on WPF since that is the exception that was thrown.

    Kevin


    Kevin Burton
    Wednesday, November 24, 2010 2:30 PM