WPF 中命名空间冲突 至少有两个名称空间(“System.Windows”和“System.Windows”)中已出现名为“VisualStateManager”的类型

错误 18 类型引用不明确。至少有两个名称空间(“System.Windows”和“System.Windows”)中已出现名为“VisualStateManager”的类型。请考虑调整程序集 XmlnsDefinition 特性。 E:C#oaHao.OAapp.xaml 1 1 ZHao.OA

 

原因

  你是不是用了WPFToolKit?如果是的,那原因就是WPFToolKit里也有VisualState,与WPF中的VisualState引用不明确,可以添加原先VisualState的引用:xmlns:sysWin="clr-namespace:System.Windows;assembly=PresentationFramework"

然后给每个VisualState、VisualStateManager还有VisualStateGroup加上sysWin前缀就可以了 , 见下图:

原文地址:https://www.cnblogs.com/Fooo/p/13186309.html