x86, x64, and AnyCPU
The platform you build for decides which native libraries of TX Text Control your deployment must contain. An x86 build needs the 32-bit set, an x64 build the 64-bit set, and an AnyCPU build whichever set matches the Windows it lands on. Here is what each configuration means for the files you ship and how to publish a .NET application for one platform.
What Each Configuration Deploys
| Configuration | Runs as | Native libraries to deploy | .NET target runtime |
|---|---|---|---|
| x86 | A 32-bit process, on 32-bit and 64-bit Windows | The 32-bit set: runtimes/win-x86/native of the package, Assembly\bin of the setup | win-x86 |
| x64 | A 64-bit process | The 64-bit set: runtimes/win-x64/native of the package, Assembly\bin64 of the setup | win-x64 |
| AnyCPU | A process with the bitness of the Windows it runs on | The set that matches the host: 32-bit on 32-bit Windows, 64-bit on 64-bit Windows | Depends on the target machines |
The managed assemblies are the same in every configuration. Only the native libraries and the Visual C++ runtime follow the bitness.
Which configuration suits your application, and how to create x86 and x64 configurations in Visual Studio, is described in Choose a Build Configuration. For AnyCPU, the deployment has to know the bitness of the target machine.
Publish a .NET Application for One Platform
A .NET application gets the native libraries of one platform when you publish it with the target runtime of the table, in the publish settings of Visual Studio or with -r of dotnet publish, as Publishing .NET Applications shows. Without a target runtime, the output keeps both sets, as Where the Files Go describes. The package contains native libraries for win-x86 and win-x64 only, so these are the two target runtimes for an application with TX Text Control.
Deploy a .NET Framework Application for One Platform
A .NET Framework application references the managed assemblies of the setup and ships the native libraries you copy next to it:
- For an x86 build, copy the files of Assembly\bin.
- For an x64 build, copy the files of Assembly\bin64.
- For an AnyCPU build, copy the set that matches the bitness of the target machine. An installer that serves 32-bit and 64-bit machines has to decide at installation which set it installs.
Never put both sets into the application folder: their files have the same names. Deploying .NET Framework Applications covers the rest of the deployment.
When the Bitness Doesn't Match
A process that doesn't find the native libraries of its own bitness can't start the engine of TX Text Control. Typical causes are an AnyCPU build that runs as a 64-bit process where only the 32-bit set was deployed, and an installer that still copies the files of another configuration. Native Libraries and Architecture Mismatches lists the error messages and the fixes.