Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The type or namespace name 'Documents' does not exist in the namespace 'System.Windows' [duplicate]

Tags:

c#

.net

The line using System.Windows.Documents; produces the following compile error:

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

I tried finding the assembly in the "add references..." dialog, but System.Windows.Documents was not listed, as it usually is when this error occurs.

Which assembly do I need to add for this using clause?

like image 614
Matthew Sainsbury Avatar asked Jan 28 '15 09:01

Matthew Sainsbury


1 Answers

Classes in this namespace are contained in the Presentation Framework assembly, and this is the reference you need to add.

This assembly also provides classes for these namespaces:

  • System.Windows.Documents
  • System.Windows.Media
  • System.Windows.Media.Animation
  • System.Windows.Shell

Note that assemblies (physical collections of classes) do not provide namespaces (logically organization of classes) per se, they contain classes which have their own classification in namespaces. So it is possible for an assembly to "contain" many namespaces, and it is possible for a namespace to appear in many assemblies. This explains why it is not listed on the MSDN page for System.Windows.Documents (Thanks CodeCaster and Damien_The_Unbeliever)

like image 127
Matthew Sainsbury Avatar answered Oct 30 '22 20:10

Matthew Sainsbury