Getting InvalidOperationException 4009 in Blend

Răspuns propus Getting InvalidOperationException 4009 in Blend

  • Sunday, December 21, 2008 10:07 PM
     
     
    When opening two user controls side by side in Expression Blend I get this error appearing:

    An Exception was thrown.

    InvalidOperationException: 4009 An error has occurred.

    StackTrace

    at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
    at MS.Internal.XcpImports.ResourceDictionary_Add(ResourceDictionary dictionary, String key, Depen.... (can't read the rest of the line)
    at System.Windows.ResourceDictionary.Add(String key, Object value)
    at System. Windows.ResourceDictionary.System.Collections.Generic.IDictionary<System.Object,System... (can't read the rest of the line)

    InnerException:None

    If I close the controls, rebuild, then reopen one of them it appears ok. But when I open the other control i get this error again.

    Any ideas....?

All Replies

  • Monday, December 22, 2008 2:35 PM
    Moderator
     
     
    Howdy,

    Do either of your controls have a dependency on each other and if so is it a binding at all?

    Cheers

    Expression MVP

    Learn Expression Blend at learnexpressionstudio.com

    my blog : http://x-coders.com/blogs/sneaky/default.aspx

  • Friday, February 06, 2009 12:10 PM
     
     Proposed Answer
    Hi,

    I had the same problem, and asked here 15 mins ago.

    After some cleaning up in my project, I have found my issue.
    It was a image resource in my App.xaml.
    The image was working in the designer, but didn't show up at runtime. After deleting the resource, error 4009 disappeared.

    greets.

    • Proposed As Answer by djsubzero Friday, February 06, 2009 12:32 PM
    •  
  • Wednesday, December 12, 2012 1:25 PM
     
      Has Code

    I have the same error when i try

    figure.Segments.Add(seg)

    not once on one 'seg' element.

    commoninterview.com/technical_questions/where-you-can-find-list-of-silverlight-error-codes-with-explanations/ link talk that 4009 error code means "Element is already the child of another element."

    Maybe you try to include one dictionary not once.