TX Text Control .NET for Windows Forms

Publishing .NET Applications

Topic

A Windows Forms application for .NET 8 or higher that references TXTextControl.TextControl.WinForms.SDK is published like any other .NET application. Publish in Visual Studio, or dotnet publish on the command line, collects your application, the assemblies of TX Text Control and the native libraries of one platform in a single folder, and that folder is what you deploy.

Before You Begin

Publish With Visual Studio

  1. In Solution Explorer, select the project, and choose Build > Publish Selection from the main menu.

  2. Select Folder as the target, and click Next:

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

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

  4. Choose the folder location, and click Finish. Visual Studio creates a publish profile.

  5. Click Show all settings to open the publish settings.

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

  6. Select win-x64 as the Target runtime, or 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.

With the target runtime set, all files of TX Text Control that the application needs, including the native libraries and the filters for the file formats, are copied to the publish folder.

Publish on the Command Line

The same publish with the .NET CLI, from the folder of the project:

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

The command works as follows:

  • -c Release publishes the release build.
  • -r win-x64 selects the target runtime, which puts the 64-bit native libraries next to the executable. Use win-x86 for a 32-bit application.
  • --self-contained false creates a framework-dependent application, which runs with the .NET Desktop Runtime installed on the user's machine. With true, the publish folder also holds the complete .NET runtime.
  • -o publish writes the output to the folder publish.

What the Publish Folder Contains

For win-x64, the publish folder holds:

FilesWhat they are
Your executable and its assemblies, such as MyApp.exe and MyApp.dllYour application, with the TX Text Control license compiled in
TXTextControl.dll, TXTextControl.Windows.Forms.dll, TXTextControl.Server.dll, TXDocumentServer.dll and the other assemblies of the packageThe managed assemblies
tx34.dll, tx34_rtf.dll, tx34_pdf.dll and the other native librariesThe 64-bit native libraries
A de folderThe German resources

There is no license file among them: the license is part of your assembly. Managed Assemblies and Native Libraries lists every file.

Publish to a folder and deploy the folder as it is. Single-file publishing isn't described for TX Text Control.

Deploy the Folder

Copy the complete content of the publish folder to the user's machine: with your own installer, with a file copy or packaged as MSIX. On the user's machine, you need:

  • The .NET Desktop Runtime of the version your project targets, for a framework-dependent application.
  • The Visual C++ runtime of the same bitness as the application; see Visual C++ Runtime Dependencies.

Neither the NuGet package nor the setup of TX Text Control is installed there. When the application fails on the user's machine, see A Published .NET Application Lacks the Native Libraries.

Next Steps