TX Text Control .NET for Windows Forms

Installation and Package Restore

Topic

Before a project builds, the NuGet package TXTextControl.TextControl.WinForms.SDK has to be found and restored, and it has to fit the target framework of the project. The package isn't published on nuget.org: it comes from the package source Text Control Offline Packages, which the setup installs, or from the Text Control Private NuGet Feed. Most installation problems come from one of these sources, and the sections below go through them. NuGet Packages describes the package and its sources in full.

The Package Isn't Found

Visual Studio or dotnet restore doesn't find TXTextControl.TextControl.WinForms.SDK.

The package isn't on nuget.org. It is in the package source Text Control Offline Packages, which the setup of TX Text Control .NET for Windows Forms installs in C:\Program Files (x86)\Text Control GmbH\NuGetPackages, and on the Text Control Private NuGet Feed.

  1. Install the setup of the full or trial version on the development machine, if it isn't installed. See Installing the Product.
  2. In Manage NuGet Packages, select Text Control Offline Packages as the package source, or the source of the private feed.
  3. Install the package again.

Text Control Offline Packages Isn't a Package Source

The list of package sources in Visual Studio has no entry Text Control Offline Packages, or the .NET CLI doesn't find the package that Visual Studio finds.

The setup registers the package source on the machine it installs on. On a machine without the setup, the source doesn't exist, and a build outside Visual Studio reads only the sources of its nuget.config files.

  1. Install the setup on the machine, or add the folder of the offline packages to the nuget.config of the project, as Text Control Offline Packages shows.
  2. Restore the packages again.

Visual Studio Doesn't Use the Private Feed

You copied your personal nuget.config into the project, but Visual Studio doesn't offer the private feed.

Visual Studio doesn't always pick up a nuget.config that you add to a project.

  1. Replace the content of a configuration file under Tools > NuGet Package Manager > Package Manager Settings > Configuration Files with your downloaded nuget.config, as Text Control Private NuGet Feed describes.
  2. In Manage NuGet Packages, select the package source TextControl.

The blog article Text Control Private NuGet Feed describes the feed.

The Private Feed Doesn't List the Package

The private feed accepts your credentials, but TXTextControl.TextControl.WinForms.SDK isn't in its list of packages.

The feed shows only the packages and versions of the products that are assigned to you as a developer. Without a license of TX Text Control .NET for Windows Forms assigned to you, its package isn't listed.

  1. List the packages the feed offers you:

    dotnet package search "TXTextControl" --source TextControl
    
  2. If the package is missing, ask the owner of your Text Control account to assign a serial number of TX Text Control .NET for Windows Forms to you.

  3. Download your nuget.config again after the assignment.

The Private Feed Rejects Your Credentials

Restoring from the private feed fails because the feed refuses your credentials.

The API token in your nuget.config has expired or was deleted. Tokens are valid for a limited time, as Text Control Private NuGet Feed describes, and when the last serial number with access to the feed is unassigned from you, your token is deleted.

  1. Ask the owner of your Text Control account to assign a serial number to you again, which extends your token or creates a new one, or to create a new token for you under Manage API tokens.
  2. Download the new nuget.config, or replace the token in your existing file and in the secrets of your build servers.

The Package Doesn't Fit the Target Framework

The package can't be installed in the project, or the project doesn't build after an update of the package.

Since version 33.0, the package targets .NET 8 and can be installed in projects that target .NET 8 or higher. The packages of version 32.0 targeted .NET 5 and, from Service Pack 2, .NET 6. A project on the .NET Framework doesn't use the package at all: it references the assemblies that the setup installs in its Assembly folder.

  1. Set the target framework of a .NET project to net8.0-windows or higher.
  2. For a project on the .NET Framework, remove the package and reference the assemblies of the setup instead, as Create a .NET Framework Application shows.

.NET and .NET Framework lists the supported versions.

Packages Don't Restore on a Build Server

A build server or a CI/CD pipeline fails to restore the package, while the build works on your machine.

Your personal nuget.config with the credentials of the private feed isn't part of the repository, and the build server has no setup and no offline packages.

  1. Store the credentials as secrets of the pipeline and create nuget.config from them before the restore, on a Windows agent, as Restore the Package From the Private Feed describes.

CI/CD contains a complete workflow.

The Project Still Uses the Old Service Pack

You installed a new service pack, but your application still runs with the previous one.

The project keeps the package version it references. The setup of a service pack adds the new package version to Text Control Offline Packages, but doesn't update your projects.

  1. In Manage NuGet Packages, open Updates and update TXTextControl.TextControl.WinForms.SDK, or run:

    dotnet add package TXTextControl.TextControl.WinForms.SDK --version 34.0.5
    
  2. Rebuild the application. dotnet list package --outdated lists the packages that have newer versions.

GetVersionInfo returns the version the application runs with, and its ServicePack the number of the service pack. Installing and Updating Packages describes the update.

References Show a Warning After Migrating to .NET

After converting a .NET Framework project to .NET with the .NET Upgrade Assistant, the references to TX Text Control are marked with a warning triangle.

The Upgrade Assistant doesn't convert the references to the assemblies of TX Text Control into the NuGet package.

  1. Remove the old references to the TX Text Control assemblies.
  2. Install TXTextControl.TextControl.WinForms.SDK from Text Control Offline Packages.
  3. Delete licenses.licx from the project; .NET projects use the license file of the package.

Migrating from .NET Framework to .NET describes the migration, and the blog article Upgrading a .NET Framework Windows Forms App to a .NET 8 Windows Forms App with TX Text Control 32.0 SP2 walks through an example.