[A] Type cannot be distinguished to [B] Type of matching assembly versions

Most recently, I started getting this strange error, this is only a problem in Designer, the application works without problems.

I tried

  • clear shadow cache
  • delete bin / obj folder
  • rebuilding solution
  • deleting and re-adding the specified assembly and performing all the above steps

This is a complete mistake.

[A]MahApps.Metro.Controls.MetroAnimatedSingleRowTabControl cannot be cast to [B]MahApps.Metro.Controls.MetroAnimatedSingleRowTabControl. Type A originates from 'MahApps.Metro, Version=1.1.3.174, Culture=neutral, PublicKeyToken=null' in the context 'LoadFrom' at location 'C:\Users\usr\AppData\Local\Microsoft\VisualStudio\14.0\Designer\ShadowCache\x2tfp5zd.b23\jgke2cb5.0ws\tmp\MahApps.Metro.dll'. Type B originates from 'MahApps.Metro, Version=1.1.3.174, Culture=neutral, PublicKeyToken=null' in the context 'LoadNeither' at location 'C:\Users\usr\AppData\Local\Microsoft\VisualStudio\14.0\Designer\ShadowCache\majxo3bg.w3c\dwou5m4n.p1u\MahApps.Metro.dll'. HeRgoT C:\Users\usr\MyProject\MyProject\MainWindow.xaml 

Any idea what is the reason?

+5
source share
1 answer

I encountered the same problem, the cause of which was several copies of the mahapps.metro.dll file in the shadow cache folder and to fix this, what I did: 1. Delete the mahapps.metro.dll file as a link to the project. 2. Close Visual Studio 3. Empty the shadow cache folder, then restart VS.

0
source

Source: https://habr.com/ru/post/1233440/


All Articles