Visual Studio 2013的XAML错误

Uch*_*chi 3 .net c# wpf xaml compiler-errors

我正在尝试构建我的项目,但不断收到以下错误消息:

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上查找如何解决此问题,但没有发现任何东西。如果有人可以为我提供解决方案或提供解决方案的文章,我将不胜感激!

Ehs*_*san 10

我遇到了同样的问题,在添加 System.Xaml.dll到我的参考文献后问题解决了!


小智 5

检查项目中使用的System.Xaml.dll版本,并与该项目的.net版本进行比较。似乎您使用的是旧版本System.Xaml.dll。您可以在文件夹C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework.NETFramework中找到其他dll。

  • 我错过了`.XAML` 程序集。甚至不知道如何添加它。我工作的朋友给我看了。#NoobStatus (3认同)