The type or name of the Documents namespace does not exist in the System.Windows namespace

String using System.Windows.Documents; creates the following compilation error:

The type or name of the Documents namespace does not exist in the System.Windows namespace (do you miss the assembly reference?)

I tried to find the assembly in the Add Links ... dialog box, but System.Windows.Documents not specified, as is usually the case with this error.

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

+6
source share
1 answer

The classes in this namespace are contained in the Presentation Framework assembly, and this is the link you must 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 (the logical organization of classes) as such; they contain classes that have their own classification in namespaces. Thus, an assembly can be โ€œcontainedโ€ in many namespaces, and a namespace can appear in many assemblies. This explains why it is not listed on the page.

+10
source

Source: https://habr.com/ru/post/981655/


All Articles