TX Text Control .NET for WPF

32-bit and 64-bit Applications

Topic

Behind the WPF controls of TX Text Control .NET for WPF works a document engine made of native Windows libraries, and those libraries are compiled twice: for 32-bit and for 64-bit processes. A WPF application therefore has to be built for the bitness it runs with and ship the matching set of libraries. The build configurations to choose from, and how to create them in Visual Studio, are explained below.

Why Bitness Matters

The managed assemblies, such as TXTextControl.WPF.dll, are the same for 32-bit and 64-bit processes. The native libraries, such as tx34.dll, exist in a 32-bit and a 64-bit set, and your application needs the set that matches the bitness of the process it runs in. Native Libraries in the Deployment Guide lists the files and the folders of the NuGet package and the setup that hold each set.

Choose a Build Configuration

ConfigurationRuns asNative libraries to deployTarget runtime for .NET
x64A 64-bit processThe 64-bit setwin-x64
x86A 32-bit process, on 32-bit and 64-bit WindowsThe 32-bit setwin-x86
AnyCPUA process with the bitness of the Windows it runs onThe set that matches the host: the 32-bit set on 32-bit Windows, the 64-bit set on 64-bit WindowsChosen per target machine
  • x64 creates a 64-bit application, which has more memory for large documents.
  • x86 creates an application that runs on both 32-bit and 64-bit Windows.
  • AnyCPU is what Visual Studio sets for a new project. It works when the set of native libraries you deploy matches the machine the application runs on.

The sample projects that the setup installs come with an x86 and an x64 build configuration.

Create x86 and x64 Configurations in Visual Studio

  1. Open your WPF project and choose Build > Configuration Manager.

  2. In the Active solution platform list, select <New...>.

    The Visual Studio Configuration Manager dialog with the Active solution platform list open, showing Any CPU, New and Edit.

  3. In the New Solution Platform dialog, select x64 and click OK.

    The New Solution Platform dialog with x64 selected as the new platform and settings copied from Any CPU.

  4. Repeat steps 2 and 3 with x86. The Active solution platform list now holds Any CPU, x64 and x86:

    The Active solution platform list of the Configuration Manager with Any CPU, x64 and x86 above the New and Edit entries, x86 selected.

  5. To remove Any CPU, select <Edit...> in the Active solution platform list, select Any CPU, click Remove and close the dialog.

  6. Close the Configuration Manager.

The platforms are now in the Solution Platforms list of the Visual Studio toolbar. Select one before you build to compile for it:

The Solution Platforms list of the Visual Studio toolbar next to the Debug configuration, with x64, x86 and Configuration Manager.

Publish a .NET Application for One Platform

A .NET 8 or higher application is published with Build > Publish Selection. In the publish settings, you select the target runtime, for example win-x64, and the publish process copies the TX Text Control files for that runtime to the output folder. Publishing .NET Applications describes the steps.

The native libraries also need the Microsoft Visual C++ runtime in the same bitness. See Visual C++ Runtime Dependencies.