0

I've been making some modifications to an app we're writing. We use the ModernUI assembly from FirstFloor. I've added a value converter class to the project, then used it in the XAML. It had been working fine, until my last attempt to build the project. Now VS 2019 is raising this error:

[A]FirstFloor.ModernUI.Windows.Controls.ModernButton cannot be cast to [B]FirstFloor.ModernUI.Windows.Controls.ModernButton. Type A originates from 'FirstFloor.ModernUI, Version=1.0.6.0, Culture=neutral, PublicKeyToken=2d21ec3cd074c59a' in the context 'LoadNeither' at location 'C:\Users\rodf\AppData\Local\Microsoft\VisualStudio\16.0_167f0483\Designer\ShadowCache\ypovrfbc.h0k\mx2qcshb.ubr\FirstFloor.ModernUI.dll'. Type B originates from 'FirstFloor.ModernUI, Version=1.0.6.0, Culture=neutral, PublicKeyToken=2d21ec3cd074c59a' in the context 'LoadNeither' at location 'C:\Users\rodf\AppData\Local\Microsoft\VisualStudio\16.0_167f0483\Designer\ShadowCache \ieygni5z.s4i\k3xscdy2.jlu\FirstFloor.ModernUI.dll'.

I have no idea what ShadowCache is; I've never seen it before.

The section of code that's raising this error is about 100 lines from where I've been working. I've made no changes to that code.

The code that's raising this error follows:

<uc:CoreSummaryControl x:Name="TheCoreSummaryControl" Grid.Row="1" Fields="{Binding TableFields}" 
                           LeftAlignedHeaders="{StaticResource LeftAlignedHeaders}" 
                           CenterAlignedHeaders="{StaticResource CenterAlignedHeaders}" 
                           RightAlignedHeaders="{StaticResource RightAlignedHeaders}" 
                           LeftAlignedColumns="{StaticResource LeftAlignedFields}" 
                           CenterAlignedColumns="{StaticResource CenterAlignedFields}" 
                           RightAlignedColumns="{StaticResource RightAlignedFields}"
                           OmittedFields="{StaticResource OmittedFields}"
                           ExtraFields="{StaticResource ExtraFields}"
                           />

I've tried clearing the solution and rebuilding it, to no avail.

Why is this section of code, that I've done nothing to, now raising an error? What is the Designer\ShadowCach all about?

Rod
  • 4,107
  • 12
  • 57
  • 81
  • 1
    Didn't you [search StackOverflow for ShadowCache](https://stackoverflow.com/search?q=%5Bwpf%5D+shadowcache)? This seems helpful: https://stackoverflow.com/a/35780402/1136211 – Clemens Sep 01 '20 at 04:38
  • Thank you, Clemens, very helpful. – Rod Sep 01 '20 at 14:46
  • I've found what might have been causing the problem. I'm assisting on a project while one of the developers who's on leave. They had FirstFloor's ModernUI, but not the most recent version. They had version 1.0.6; the most recent version is 1.0.9. Replacing that has eliminated the error. – Rod Sep 01 '20 at 15:45

0 Answers0