无法将[A]类型强制转换为匹配的程序集版本的[B]类型 [英] [A]Type cannot be cast to [B]Type of matching assembly versions

查看:266
本文介绍了无法将[A]类型强制转换为匹配的程序集版本的[B]类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我开始遇到这个奇怪的错误,这只是Designer中的唯一问题,应用程序运行没有问题。

Just recently I started getting this weird error, it's only problem in Designer, the app runs with no problems.

我已经尝试


  • 清除影子缓存

  • 删除bin / obj文件夹

  • 重建解决方案

  • 删除并重新添加提到的程序集,然后再次执行以上所有操作

  • clearing the shadow cache
  • removing bin/obj folder
  • rebuilding solution
  • removing and re-adding the mentioned assembly and doing all above again

这是完整的错误

[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

你知道原因是什么吗?

推荐答案

我遇到了同样的问题,这是由多份玛普菌造成的影子缓存文件夹中的.metro.dll,要解决此问题,我做了以下操作:
1.卸载mahapps.metro.dll作为对项目
的引用2.关闭Visual Studio
3.清除阴影缓存文件夹,然后重新启动VS。

I've encountered the same problem this was caused by multiple copies of mahapps.metro.dll in shadow cache folder and to fix this what I did was: 1. Uninstall mahapps.metro.dll as reference to the project 2. Close Visual Studio 3. Clear Shadow cache folder, then restart VS.

这篇关于无法将[A]类型强制转换为匹配的程序集版本的[B]类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆