The type name 'IComponentConnector' could not be found in the namespace 'System.Windows.Markup'

场景:Visual Studio写WPF项目时,想要生成XML文件,默认的WPF项目没有引入System.XML这个dll。在【解决方案资源管理器——引用】右键添加了System.XML引用后,运行项目得到这个报错。

The type name 'IComponentConnector' could not be found in the namespace 'System.Windows.Markup'

原因:导入System.XML后,其中有部分内容又依赖于System.Xaml这个dll。

解决方法:所以继续添加System.Xaml的引用到项目中即可。

 

启发:https://stackoverflow.com/questions/4387812/visualstudio-bug

posted @ 2018-03-21 23:46  霍莉雪特  阅读(889)  评论(0编辑  收藏  举报