微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

参见英文答案 > 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)

原文地址:https://www.jb51.cc/csharp/91328.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐