Application.Current.Shutdown();在装配中被定义没有被引用 [英] Application.Current.Shutdown(); is defined in an assembly not referenced

查看:443
本文介绍了Application.Current.Shutdown();在装配中被定义没有被引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下错误:

错误1型'System.Windows.Markup.IQueryAmbient'在$ B定义$ b未引用的程序集。您必须添加到
集的引用System.Xaml,版本= 4.0.0.0,文化=中立,
公钥= b77a5c561934e089'。

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'.

在执行以下操作:

public void ExitApplication()
{
    Application.Current.Shutdown();
}



该项目针对的是.NET 4.0,我的Visual Studio是2010年,我尝试添加

The project is targeted to .NET 4.0, my Visual Studio is 2010, I tried adding

使用System.Windows.Markup; 无更迭,以及

使用System.Xaml; ,其中的XAML在名字空间不存在系统

using System.Xaml; where Xaml doesn't exist in namespace System.

我应该怎么做才能解决这个问题?

What should I do to fix this?

推荐答案

好吧好吧,我想,当你添加的系统您的问题就解决了。 Xaml.dll 的参考到项目中。接口被宣告存在。这里是 DOC

Well ok, I guess your issue is solved when you add System.Xaml.dll as reference to your project. The interface is declared there. Here is the doc.

这篇关于Application.Current.Shutdown();在装配中被定义没有被引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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