InvalidCastException and AutoCompleteBox

5 posts, 0 answers
  1. rcmp-grc
    rcmp-grc avatar
    13 posts
    Member since:
    Dec 2016

    Posted 21 Sep 2018 Link to this post

    This control has been working fine until today, but now it cannot be displayed for some reason.  This occurred after I added an empty WPF Custom Control Library project to the solution, which I have since removed...

     

    The element "acbSelectPerson" could not be displayed because of a problem with Telerik.Controls.RadAutoCompleteBox:

    InvalidCastException:

    [A]Telerik.Windows.Controls.RadListBox cannot be cast to [B]Telerik.Windows.Controls.RadListBox. Type A originates from 'Telerik.Windows.Controls, Version=2016.2.613.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' in the context 'LoadFrom' at location 'C:\Program Files (x86)\Telerik\UI for WPF Q2 2016\Binaries\WPF45\Telerik.Windows.Controls.dll'. Type B originates from 'Telerik.Windows.Controls, Version=2016.2.613.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' in the context 'LoadNeither' at location 'C:\Users\000105261\AppData\Local\Microsoft\VisualStudio\14.0\Designer\ShadowCache\13qxpo3c.c3s\4xmqqihl.1si\Telerik.Windows.Controls.dll'.

    Stack Trace:

       at Telerik.Windows.Controls.RadAutoCompleteBox.InitializeItemsControlPart()
       at Telerik.Windows.Controls.RadAutoCompleteBox.OnApplyTemplate()
       at System.Windows.FrameworkElement.ApplyTemplate()
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Border.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
       at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Border.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Control.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
       at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)
       at System.Windows.Controls.Control.MeasureOverride(Size constraint)
       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       at System.Windows.UIElement.Measure(Size availableSize)

  2. Magdalena
    Magdalena avatar
    2 posts
    Member since:
    Mar 2019

    Posted 29 May in reply to rcmp-grc Link to this post

    Hi rcmp-grc!

    I have exactly the same problem. Did you solve it?

  3. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2240 posts

    Posted 30 May Link to this post

    Hello Don,

    I could suggest you to check the Resolving Design Time Errors article. It is about design-time issues, but the steps there could also resolve few run-time dll related errors. Also, I would recommend you to double check if all the referenced Telerik WPF dlls originate from the same version (example: 2018.3 911). 

    Regards,
    Martin Ivanov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  4. rcmp-grc
    rcmp-grc avatar
    13 posts
    Member since:
    Dec 2016

    Posted 30 May in reply to Magdalena Link to this post

    Hi Magdalena!

    Sadly no I was unable to resolve the issue, it made no sense to me. Perhaps Martin's suggestion below will be of help... good luck!!! 

  5. Magdalena
    Magdalena avatar
    2 posts
    Member since:
    Mar 2019

    Posted 03 Jun Link to this post

    Hi!

    Thank you, rcmp-grc!

    I could finally solve the problem by deleting the debug folders of all projects and deleting all temp folders in the telerik folder in the program files.

    Thank yo

Back to Top