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

前端之家收集整理的这篇文章主要介绍了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.f2er.com/csharp/91328.html

猜你在找的C#相关文章