我该如何解决它...... System.Windows.Markup.Iqueryambient [英] How Do I Solve It....System.Windows.Markup.Iqueryambient

查看:261
本文介绍了我该如何解决它...... System.Windows.Markup.Iqueryambient的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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\jvm\documents\visual studio 2013\Projects\firstwpf\firstwpf\UserControl1.xaml.cs	21	26	firstwpf
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\jvm\documents\visual studio 2013\Projects\firstwpf\firstwpf\obj\Debug\UserControl1.g.cs	40	100	firstwpf

推荐答案

错误消息显示您需要添加对 System.Xaml 的引用。在Visual Studio中,打开解决方案资源管理器,右键单击引用,选择添加引用...并在程序集列表中查找System.Xaml。
The error message says that you need to add a reference to System.Xaml. In Visual Studio, open the Solution Explorer, right-click "References", select "Add Reference..." and look for System.Xaml in the assembly list.


解决方案中的答案1正是导致错误的原因,但是如果你正在创建一个WPF应用程序,那么这些引用应该在项目创建时自动添加到项目中。



因为那,你应该检查你在创建项目时选择了正确的模板(例如WPF应用程序)。如果该项目是其他项目,则可能需要在工作之前进行大量修改。
The answer in solution 1 is exactly what causes the error but if you're creating a WPF application, these references should be added to the project automatically when the project is created.

Because of that, you should check that you have selected correct template when creating the project (e.g. WPF Application). If the project is something else, the chances are that that you need to make a whole lot modifications before you get it working.


这篇关于我该如何解决它...... System.Windows.Markup.Iqueryambient的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆