TX Spell .NET for Windows Forms

Installing and Updating Packages

Topic

A project for .NET 8 or higher gets TX Spell .NET for Windows Forms by installing a NuGet package, in the NuGet Package Manager of Visual Studio or with the .NET CLI. The package adds the assemblies, embeds your license and copies the US English language data into the output folder. When a service pack comes out, you update the package to the new version.

Before You Start

  • A project for .NET 8 or higher, created for example with the template Windows Forms App.
  • A package source with the packages: Text Control Offline Packages on a machine with the setup, or the Text Control Private NuGet Feed; see Configuring Package Sources.

Install the Package in Visual Studio

  1. Select the project in Solution Explorer and choose Project > Manage NuGet Packages....

  2. Select Text Control Offline Packages in the Package source list, or TextControl for the private feed, and click Browse.

  3. Select TXTextControl.TXSpell.WinForms.SDK, or TXTextControl.TXSpell.Core.SDK for code without a user interface, and click Install.

    The NuGet Package Manager of Visual Studio with the package source Text Control Offline Packages and the search term TXSpell, listing TXTextControl.TXSpell.Core.SDK and TXTextControl.TXSpell.WinForms.SDK, here in version 11.0.0, with the details of the Core package.

After the installation, the toolbox has the tab TXSpell 11.0 with the TXSpellChecker component, when a form is open in the designer.

Install the Package With the .NET CLI

With the package source in a nuget.config next to the solution, add the package in the folder of the project:

dotnet add package TXTextControl.TXSpell.WinForms.SDK

The command installs the newest version and reports it:

info : PackageReference for package 'TXTextControl.TXSpell.WinForms.SDK' version '11.0.1' added to file '...csproj'.

dotnet add package also takes a --source option with a folder or a feed. That source then replaces all others for the restore, so packages from nuget.org can no longer be found; a nuget.config is the safer way.

What Changes in the Project

The project file gets a package reference:

<PackageReference Include="TXTextControl.TXSpell.WinForms.SDK" Version="11.0.1" />

When you build, the license file txspell.winforms.license is embedded into your assembly, and the folders Dictionaries, HyphenationLists, SynonymLists and LanguageRecognition are copied into the output folder next to TXSpell.dll. Package Overview lists the contents.

Only .NET 8 or Higher

The packages target .NET 8. In a project for .NET 5, .NET 6, .NET 7 or the .NET Framework, NuGet installs them without an error, but the build fails; The Package Doesn't Fit the Target Framework explains why and what to do.

Update to a New Service Pack

  1. Install the setup of the service pack. The same setup file updates an existing installation and adds the new package versions to Text Control Offline Packages. On the private feed, the new versions appear without a setup.
  2. In Visual Studio, open Manage NuGet Packages..., select the Updates tab, select the package and click Update.

With the .NET CLI, list the packages that have a newer version, then update:

dotnet list package --outdated
dotnet add package TXTextControl.TXSpell.WinForms.SDK --version 11.0.1

Version="11.0.1" in the project file means version 11.0.1 or higher. To stay on exactly one version, for example on a build server, write the version in brackets: Version="[11.0.1]". Service Packs lists what each service pack changed.