TX Text Control .NET for WPF

Publishing .NET Applications

Topic

Publishing turns a WPF project for .NET 8 or higher into a folder you can deploy. With TXTextControl.TextControl.WPF.SDK referenced, Visual Studio's Publish and the dotnet publish command copy the assemblies of TX Text Control and, for the target runtime you select, its native libraries next to your executable. Set the target runtime, and the folder is complete.

Before You Begin

Publish With Visual Studio

  1. Select the WPF project in Solution Explorer, and choose Build > Publish Selection.

  2. Select Folder, and click Next:

    The Publish dialog of Visual Studio with the question where you are publishing today and the targets Azure, ClickOnce, Docker Container Registry and Folder, with Folder selected.

  3. Select Folder once more as the specific target, and click Next.

  4. Choose where to publish, and click Finish. Visual Studio saves the choices as a publish profile.

  5. Click Show all settings:

    The Publish tab of Visual Studio, here for a Windows Forms project, with the folder profile FolderProfile.pubxml ready to publish, the settings Target location, Configuration Release and Target runtime Portable, and the Show all settings link circled.

  6. Set Target runtime to win-x64, or to win-x86 for a 32-bit application, and click Save.

    The Profile settings dialog of a Visual Studio folder publish profile with the configuration Release, the target framework net8.0-windows, the deployment mode Framework-dependent and the target runtime win-x64.

  7. Click Publish.

The target runtime is what makes the publish folder complete: with it, all files of TX Text Control the application needs, the native libraries and the format filters included, are copied there.

Publish With the .NET CLI

In a terminal, in the folder of the WPF project:

dotnet publish -c Release -r win-x64 --self-contained false -o publish

What the options do:

  • -c Release publishes the release configuration.
  • -r win-x64 is the target runtime: the 64-bit native libraries go next to the executable. For 32-bit, use win-x86. These are the only runtimes for which the package contains native libraries. Without -r, both sets stay in the output, in runtimes\win-x86\native and runtimes\win-x64\native.
  • --self-contained false publishes framework-dependent: the application runs with the .NET Desktop Runtime of the user's machine. --self-contained true adds the .NET runtime to the folder instead.
  • -o publish names the output folder.

The Publish Folder

After a win-x64 publish, the folder contains:

FilesRole
Your executable and assemblies, such as MyApp.exe and MyApp.dllThe application, with the TX Text Control license embedded
TXTextControl.WPF.dll, TXTextControl.dll, TXTextControl.Server.dll and the other assemblies of the packageThe managed part of TX Text Control
tx34.dll, tx34_dox.dll, tx34_pdf.dll and the other native librariesThe 64-bit document engine
deThe German resources

The folder has no license file, because the license is inside your assembly. The complete list of files is on Managed Assemblies and Native Libraries.

Deploy the folder as a whole. Single-file publishing isn't described for TX Text Control.

Deploy the Folder

Copy the content of the publish folder to the user's machine with your installer, a file copy or an MSIX package. That machine needs:

  • The .NET Desktop Runtime of your target version, if the application is framework-dependent.
  • The Visual C++ runtime in the bitness of the application; see Visual C++ Runtime Dependencies.

The NuGet package and the setup of TX Text Control aren't needed there. If the application fails after deployment, see A Published .NET Application Lacks the Native Libraries.

Next Steps