TX Text Control .NET for WPF

Build Servers

Topic

A build agent that compiles a WPF application with TX Text Control has no setup and no developer of its own. It needs the licensed package TXTextControl.TextControl.WPF.SDK and the credentials to download it, kept out of your repository. The rules for build servers come first below, followed by the private feed, an Azure Artifacts feed and the special case of .NET Framework projects.

What the License Agreement Allows

A build server or CI/CD system that only compiles, tests or packages your application needs no developer license, as long as every developer who works with TX Text Control has one and nobody develops interactively on the build machine. The packages may be kept in an internal repository for your licensed developers and build systems. Licensing Overview states these rules and the rest of the licensing model.

Build With the Private Feed

The WPF package on the Text Control Private NuGet Feed exists for this job: it compiles projects on build servers and in pipelines, while the designers stay on the development machines with the setup. The feed injects the license of the authenticated developer into the package, so the build needs no license step of its own.

  1. Store three values as secrets of your CI/CD system: TEXTCONTROL_EMAIL with the email address of a developer who has a serial number of TX Text Control .NET for WPF assigned, TEXTCONTROL_API_TOKEN with that developer's API token and TEXTCONTROL_FEED_URL with https://www.textcontrol.com/nuget/v3/index.json.
  2. Before the restore step, write nuget.config from the secrets. It has the structure of the downloaded file shown in Configuring Package Sources.
  3. Restore and build the project on a Windows agent, as Text Control's pipeline for WPF projects does.

The credentials never reach the repository this way. An automatically created API token expires after 365 days: when the token is replaced, update the secret.

The blog article Text Control Private NuGet Feed has complete configurations for GitHub Actions, GitLab CI/CD, Azure DevOps, Jenkins, Bitbucket Pipelines and TeamCity. Its samples run on Linux agents and images; for a WPF project, change the agent to Windows, for example windows-latest in Azure Pipelines.

Build With Your Own Feed

A build can also restore from a feed in your organization, such as Azure Artifacts:

  1. Create a feed in Azure Artifacts and push the package from C:\Program Files (x86)\Text Control GmbH\NuGetPackages on a development machine to it. Configuring Package Sources has the steps.
  2. Add the feed to the nuget.config of the project, with a personal access token as the password.
  3. In azure-pipelines.yml, run the pipeline on a windows-latest agent, restore with the task NuGetCommand@2 and feedsToUse: 'config', and build with VSBuild@1.

The package in the offline folder contains the license of the installation it comes from, and since version 32.0 with Service Pack 2, a .NET project needs no separately compiled license. The blog article Azure Pipelines with TX Text Control .NET for WPF and Windows Forms 32.0 with Azure DevOps and Artifacts shows the complete pipeline.

.NET Framework Projects

A .NET Framework project is licensed through licenses.licx and the license compiler lc.exe, which needs the TX Text Control assemblies of an installation. A hosted build agent has no setup, so Text Control's articles compile the license once on a development machine and add the result to the project as an embedded resource.

Call lc.exe in the output folder of your application, next to the executable and licenses.licx. Since version 30.0, each /i option must name the full path of an assembly in the Assembly folder of the installation; otherwise an older version can be used. The blog article Version 30.0: Changes in Licenses.licx shows the command.