Deploying .NET Framework Applications
WPF applications for the .NET Framework 4.x use TX Text Control .NET for WPF from its setup, not from a NuGet package. The project references the assemblies of the installation, and the deployment is up to you: the managed assemblies, the native libraries of your platform and your executable go into one folder on the user's machine. Here is where the files are, how to arrange them and how to deploy with ClickOnce.
The Folders of the Setup
By default, the setup installs into C:\Program Files\Text Control GmbH\TX Text Control 34.0.NET for WPF. The files you deploy come from three of its folders:
| Folder | Files | Needed by |
|---|---|---|
| Assembly | The managed assemblies: TXTextControl.WPF.dll, TXTextControl.dll, TXTextControl.Server.dll, TXDocumentServer.dll and the others | Every application |
| Assembly\bin | The 32-bit native libraries | x86 builds, and AnyCPU builds on 32-bit Windows |
| Assembly\bin64 | The 64-bit native libraries | x64 builds, and AnyCPU builds on 64-bit Windows |
Both sets of native libraries use the same file names, so only one of them can be in the application folder, and an installer for an AnyCPU build installs the set of the machine it runs on. Managed Assemblies and Native Libraries lists the files. Take the names of the native libraries from the bin folders of your installation: the requirements documentation of TX Text Control still names those of an older version.
Arrange the Files
The files of TX Text Control must be in the application's root folder, beside the executable, as Where the Files Go explains.
- Copy the managed assemblies from Assembly.
- Copy the native libraries of your platform: Assembly\bin for x86, Assembly\bin64 for x64. An AnyCPU build needs the set that matches the bitness of the target machine; see x86, x64, and AnyCPU.
- Keep all files at the level of the executable, without subfolders.
- Install the Visual C++ runtime of the same bitness on the target machine; see Visual C++ Runtime Dependencies.
No license file is part of the deployment. The license compiler compiled the license from licenses.licx into your executable during the build; see Application Licensing.
Make the Native Libraries Part of the Build
If your installer collects its files from the build output, let the build copy the native libraries as well:
- In Solution Explorer, select the WPF project, and choose Project > Add Existing Item.
- Navigate to Assembly\bin or Assembly\bin64 of the installation, select all files and add them.
- With the added files selected, set Build Action to Content and Copy to Output Directory to Copy always.
From then on, every build puts the native libraries next to the assemblies. Replace the added files when you move to a new major version: the names of the native libraries contain the version number.
Publish With ClickOnce
ClickOnce installs a WPF application from a link on a website and delivers the updates you publish to the server automatically. It publishes only files that are part of the project, so add the native libraries first, as the previous section shows. Then set up the project:
- Open the properties of the project.
- On Signing, check Sign the ClickOnce manifests. When you publish, Visual Studio creates a test certificate unless you select a certificate of your own.
- On Security, enable the ClickOnce security settings, and select This is a full trust application.
- On Publish, open Application Files, and set the Publish Status of every file to Include.
- Start the publish with the Publish Wizard or Publish Now.
These steps come from the blog article Deploying TX Text Control .NET Applications Using ClickOnce, written for Windows Forms and WPF applications and an earlier Visual Studio.
Moving to .NET
In a .NET 8 or higher project, the NuGet package brings all files, and publishing with a target runtime collects them. Migrating from .NET Framework to .NET walks through the change, and Publishing .NET Applications through the deployment that follows.