TX Spell .NET for Windows Forms

Publishing .NET Applications

Topic

A Windows Forms application for .NET 8 or higher that uses the NuGet package TXTextControl.TXSpell.WinForms.SDK is published like any other .NET application: Publish in Visual Studio, or dotnet publish on the command line, creates one folder that holds your application, the assemblies of TX Spell .NET and its language data. You deploy that folder, and the application checks spelling on the user's machine as it did on yours.

Before You Begin

Publish With Visual Studio

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

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

    The Publish dialog of Visual Studio asking Where are you 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 to publish to, and click Finish. Visual Studio creates a publish profile.

  5. On the Publish tab, click Show all 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. When the application also uses TX Text Control, select win-x64 as the Target runtime. Without TX Text Control, TX Spell .NET is platform-independent, and you can keep Portable:

    The publish profile settings with the Target runtime list open, showing Portable, the win, osx and linux runtimes, and the deployment mode Framework-dependent.

    The screenshot shows a project for net8.0; a Windows Forms project targets net8.0-windows. The linux-x64 runtime in the list applies to server applications, not to Windows Forms.

  7. Click Save, then Publish.

Publish on the Command Line

The same publish with the .NET CLI, for an application that uses TX Text Control:

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

Without TX Text Control, no runtime is needed:

dotnet publish -c Release

The files of TX Spell .NET in the publish folder are the same either way; Assemblies and Language Data Folders lists them. Only TX Text Control needs the runtime: without one, its native libraries go into runtimes\win-x86\native and runtimes\win-x64\native; with win-x64, they sit next to the executable.

Framework-Dependent or Self-Contained

Deployment modeThe user's machine needsThe publish folder holds
Framework-dependent (the default)The .NET Desktop Runtime of the version your project targetsYour application and the files of TX Spell .NET
Self-contained (--self-contained true, requires a runtime)NothingThe same, plus the complete .NET runtime

TX Spell .NET works the same in both modes.

Publish an ASP.NET Core Application

An ASP.NET Core application that checks text with the TXSpell class, or hosts the Document Editor of TX Text Control .NET Server, uses the package TXTextControl.TXSpell.Core.SDK instead of the Windows Forms package. It brings TXSpell.dll, the de folder with the German texts and the four language data folders, and copies them into the build and publish output in the same way, so the steps above apply unchanged.

When the application uses TX Text Control as well, select linux-x64 for a Linux server or win-x64 for a Windows server as the Target runtime:

dotnet publish -c Release -r linux-x64 --self-contained false

Without TX Text Control, TX Spell .NET needs no runtime there either. Copy the complete publish folder to the server. TX Text Control .NET Server Document Editor describes spell checking in the editor on Linux and in Docker containers.

Single File and Trimming

Publish to a folder. Single-file publishing isn't described for TX Spell .NET, and even then the four language data folders would stay loose next to the executable. Trimming isn't available: the .NET SDK refuses PublishTrimmed for Windows Forms applications.

Deploy the Folder

Copy the complete content of the publish folder to the user's machine, with your installer or any other tool. Neither the NuGet package nor the setup of TX Spell .NET is needed there, and there is no license file to add, because the license is inside your assembly. When the application misses files on the user's machine, see A Published Application Misses Files.

Next Steps