加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 名称空间’System.Windows’中不存在类型或命名空间名称’

发布时间:2020-12-15 04:31:27 所属栏目:百科 来源:网络整理
导读:参见英文答案 How to find an assembly name for a .NET namespace,for example,Microsoft.WindowsAzure.ServiceRuntime2个 该行使用System.Windows.Documents;产生以下编译错误: The type or namespace name ‘Documents’ does not exist in the namespac
参见英文答案 > How to find an assembly name for a .NET namespace,for example,Microsoft.WindowsAzure.ServiceRuntime2个
该行使用System.Windows.Documents;产生以下编译错误:

The type or namespace name ‘Documents’ does not exist in the namespace ‘System.Windows’ (are you missing an assembly reference?)

我尝试在“添加引用…”对话框中找到程序集,但未列出System.Windows.Documents,因为通常是在发生此错误时.

我需要为此using子句添加哪个程序集?

解决方法

此命名空间中的类包含在Presentation Framework程序集中,这是您需要添加的引用.

此程序集还为这些名称空间提供了类:

> System.Windows.Documents
> System.Windows.Media
> System.Windows.Media.Animation
> System.Windows.Shell

请注意,程序集(类的物理集合)本身不提供名称空间(逻辑上是类的组织),它们包含在名称空间中具有自己的分类的类.因此,程序集可以“包含”许多名称空间,并且命名空间可以出现在许多程序集中.这解释了为什么它没有列在MSDN page上的System.Windows.Documents(感谢CodeCaster和Damien_The_Unbeliever)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读