# Resolving FileNotFoundException for System.Text.Encoding.CodePages in RadWordsProcessing

## Environment

| Version    | Product            | Author                                                                          |
| ---------- | ------------------ | ------------------------------------------------------------------------------- |
| 2024.2.426 | RadWordsProcessing | [Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova) |

## Description

When you use [RadWordsProcessing](https://www.telerik.com/document-processing-libraries/documentation/libraries/radwordsprocessing/overview) in a WPF/WinForms project that targets .NET 6.0, a `System.IO.FileNotFoundException` error occurs. The error states that the file for assembly `System.Text.Encoding.CodePages, Version=7.0.0.0` cannot be found. This issue arises when you use the `Telerik.Windows.Documents.Flow.FormatProviders.Html.HtmlFormatProvider`.

![WPF project Net6](https://www.telerik.com/document-processing-libraries/documentation/assets/29ba903b6fb62bb3d9faa49df58b93fd/wpf-net6-project.png)

![Encoding CodePages Error](https://www.telerik.com/document-processing-libraries/documentation/assets/2c501fad931b4a912658109139875f80/codepages-error.png)

## Solution

To resolve the `FileNotFoundException` for `System.Text.Encoding.CodePages` in a .NET 6.0 project that uses RadWordsProcessing, follow these steps:

1. Right-click your project and edit the `.csproj` file.

   ![Edit proj file](https://www.telerik.com/document-processing-libraries/documentation/assets/22170d75ca00aac2eb14bf240498b7b3/edit-wpf-net6-project.png)

2. Add the `PackageReference` entry for `System.Text.Encoding.CodePages` and a `FunctionsPreservedDependencies` entry for it:

```xml
<ItemGroup>
  <PackageReference Include="Telerik.Windows.Documents.Flow" Version="2024.2.426" />
  <PackageReference Include="System.Text.Encoding.CodePages" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
  <FunctionsPreservedDependencies Include="System.Text.Encoding.CodePages.dll" />
</ItemGroup>
```

![Add PackageReference](https://www.telerik.com/document-processing-libraries/documentation/assets/b481191dd7af5b5c588f3d23802bacee/codepages-package-reference-net6-project.png)

These entries include the required package references in your project and resolve the `FileNotFoundException`.

> note Ensure that your project targets .NET 6.0 and that all NuGet package versions are compatible with your project setup.

## See Also

* [RadWordsProcessing](https://www.telerik.com/document-processing-libraries/documentation/libraries/radwordsprocessing/overview)
