2016-12-13 125 views
1

我試圖建立我的項目,我不斷收到以下錯誤消息:XAML錯誤的Visual Studio 2013

Error 1 The type 'System.Windows.Markup.IQueryAmbient' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. C:\Users\Geoff\Git\My Shopping List\My Shopping List\RunWindowItemList.xaml.cs 24 26 My Shopping List

Error 2 The type name 'IComponentConnector' could not be found in the namespace 'System.Windows.Markup'. This type has been forwarded to assembly 'System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' Consider adding a reference to that assembly. C:\Users\Geoff\Git\My Shopping List\My Shopping List\obj\Debug\RunWindowItemList.g.cs 40 91 My Shopping List

我試圖尋找了MSDN上如何亡羊補牢,但我還沒有找到任何東西。如果有人能幫助我解決方案或有解決方案的文章,我將不勝感激!

+1

找到其他的dll。在2012年,對我來說總是有效的是終止設計器進程XDecProc ..希望它仍然有幫助在2013年 – Yitzchak

回答

2

檢查項目中使用的System.Xaml.dll版本,並與該項目的.net版本進行比較。似乎你使用舊版本的System.Xaml.dll。你可以在文件夾C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework.NETFramework

+0

我會告訴你,如果這有效。 –

+0

@GeoffOverfield,在我的項目中更改.net版本4-> 4.5.2後出現此問題。同時檢查引用庫的屬性「Copy local」。我第一次沒有成功。老圖書館被放置在項目的文件夾和VS無法添加所需的DLL。 – Vadzim

+0

我錯過了'.XAML'程序集。甚至不知道如何添加它。我工作的哥們給我看。 #NoobStatus –