【问题标题】:XAML Error for Visual Studio 2013Visual Studio 2013 的 XAML 错误
【发布时间】:2017-04-28 01:45:36
【问题描述】:

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

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 上查找如何纠正这种情况,但我没有找到任何东西。如果有人可以帮助我提供解决方案或有解决方案的文章,我将不胜感激!

【问题讨论】:

  • 在 vs 2012 中总是对我有用的是终止设计流程,XDecProc.. 希望它在 2013 年仍然有用

标签: c# .net wpf xaml compiler-errors


【解决方案1】:

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

【讨论】:

    【解决方案2】:

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

    【讨论】:

    • @GeoffOverfield,在我的项目中更改 .net 版本 4->4.5.2 后,我遇到了这个问题。还要检查引用库的属性“复制本地”。我第一次没有成功。旧库放置在项目文件夹中,VS 无法添加所需的 dll。
    • 我错过了.XAML 程序集。也不知道怎么加。我工作的伙伴给我看了。 #NoobStatus
    猜你喜欢
    • 1970-01-01
    • 2014-06-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-09
    • 2014-01-09
    • 2014-07-15
    • 1970-01-01
    相关资源
    最近更新 更多