This is a migrated thread and some comments may be shown as answers.

InvalidCastException and AutoCompleteBox

4 Answers 183 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
rcmp-grc
Top achievements
Rank 1
rcmp-grc asked on 21 Sep 2018, 10:16 PM

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)

4 Answers, 1 is accepted

Sort by
0
Magdalena
Top achievements
Rank 1
answered on 29 May 2019, 09:10 AM

Hi rcmp-grc!

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

0
Martin Ivanov
Telerik team
answered on 30 May 2019, 09:18 AM
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.
0
rcmp-grc
Top achievements
Rank 1
answered on 30 May 2019, 02:36 PM

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!!! 

0
Magdalena
Top achievements
Rank 1
answered on 03 Jun 2019, 07:06 AM

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

Tags
AutoCompleteBox
Asked by
rcmp-grc
Top achievements
Rank 1
Answers by
Magdalena
Top achievements
Rank 1
Martin Ivanov
Telerik team
rcmp-grc
Top achievements
Rank 1
Share this question
or