1. 程式人生 > >The type name 'IComponentConnector' could not be found in the namespace 'System.Windows.Markup'

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

xaml namespace 管理器 運行 alt component inf 資源管理器 class

場景: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的引用到項目中即可。

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