# XAML Namespaces and Assembly References

> Fix XAML namespace and reference problems of TX Text Control .NET for WPF: the xmlns declaration, the prefix, and references to the assemblies of old versions.

- **Product:** TX Text Control .NET for WPF
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET for WPF > Troubleshooting > XAML Namespaces and Assembly References
- **763 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/troubleshooting/xaml-namespaces/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/troubleshooting/xaml-namespaces/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/troubleshooting/xaml-namespaces/llms-full.txt

---

XAML finds the controls of TX Text Control through a namespace declaration that maps a prefix, such as `WPF`, to the namespace `TXTextControl.WPF` in the assembly *TXTextControl.WPF*. When the declaration is missing, the prefix doesn't match, or the project references the assemblies of another version, the XAML of the window doesn't compile or the designer shows errors. [Assemblies and XAML Namespaces](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/installation/xaml-namespaces/llms-full.txt) lists the namespaces and assemblies.

### The Controls Aren't Recognized in XAML

The XAML of a window uses `WPF:TextControl` or another control of TX Text Control, and the XAML doesn't compile, or the designer doesn't know the element.

The window has no namespace declaration for the prefix, or the prefix of the declaration differs from the prefix of the elements. When you add a control from the toolbox, Visual Studio adds the declaration to the `Window` element; when you write the XAML yourself, you add it.

1. Add the declaration to the `Window` element:

    ```xml
    xmlns:WPF="clr-namespace:TXTextControl.WPF;assembly=TXTextControl.WPF"
    ```
2. Use the same prefix for every element of TX Text Control, such as `<WPF:TextControl />`. The prefix is your choice: the samples use `WPF` or `my`, the reference uses `tx`, but one window must use the one it declares.
3. Build the project, so that the designer loads the assembly.

[Add TextControl in XAML](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/document-editor/xaml/llms-full.txt) shows a complete window.

### The Reference to TXTextControl.WPF Is Missing

The namespace is declared, but the assembly *TXTextControl.WPF* can't be found.

In a .NET project, the references come from the package `TXTextControl.TextControl.WPF.SDK`, which contains the assemblies of the controls and the engine. In a .NET Framework project, you reference the assemblies of the setup, and Visual Studio adds the reference to *TXTextControl.WPF* when you add the first control from the toolbox.

1. In a .NET project, install `TXTextControl.TextControl.WPF.SDK`, as [Installation and Package Restore](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/troubleshooting/installation/llms-full.txt) describes.
2. In a .NET Framework project, add references to *TXTextControl.dll* and *TXTextControl.WPF.dll* from the *Assembly* folder of the TX Text Control installation.
3. When Visual Studio asks to restart the XAML Designer, confirm it, as [Toolbox and XAML Designer](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/troubleshooting/toolbox/#the-xaml-designer-asks-to-restart) describes.

### The Project References the Assemblies of an Earlier Version

A .NET Framework project, for example a sample from GitHub, doesn't build, or it references assemblies in a folder that doesn't exist on your machine.

The project references the assemblies of the version it was written for, sometimes with a path to an installation directory on another machine.

1. Remove the references to *TXTextControl.dll* and *TXTextControl.WPF.dll*.
2. Add them again from the *Assembly* folder of your installation.
3. In *licenses.licx*, change the version in each entry to the version of the new assemblies, and rebuild the project.

[Update an Older Sample](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/examples/github/#update-an-older-sample) describes the changes for the samples on GitHub, and [Upgrading from Previous Versions](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/installation/upgrading/previous-versions/llms-full.txt) for your own projects.

### Related Pages

- [Assemblies and XAML Namespaces](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/installation/xaml-namespaces/llms-full.txt): the namespaces and assemblies of the controls.
- [XAML Integration](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/integration/xaml/llms-full.txt): declare and configure the controls in XAML.
- [Toolbox and XAML Designer](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/troubleshooting/toolbox/llms-full.txt): the toolbox and the designer.

---

## Nearby

- **Previous:** [Toolbox and XAML Designer](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/troubleshooting/toolbox/llms-full.txt)
- **Next:** [Control Initialization](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/troubleshooting/initialization/llms-full.txt)
