.NET Licensing: How to Use the Licenses.licx File?
In order to deploy an application with licensed components like TX Text Control, the EXE file must be licensed properly. Very often, we are getting requests about this mechanism of the .NET Framework that shows the confusion about it. This article explains how .NET includes the licenses of licensed controls into the exeutables. The .NET licensing mechanism recommends to add the licenses to the EXE - the calling assembly. What happens in detail? If you drag and drop a TextControl from the…

In order to deploy an application with licensed components like TX Text Control, the EXE file must be licensed properly.
Very often, we are getting requests about this mechanism of the .NET Framework that shows the confusion about it. This article explains how .NET includes the licenses of licensed controls into the exeutables.
The .NET licensing mechanism recommends to add the licenses to the EXE - the calling assembly. What happens in detail?
If you drag and drop a TextControl from the Visual Studio toolbox to a form, Visual Studio creates a licenses.licx file and includes the license information. This file is located in the same folder like your project file.
Important: The licenses.licx file does not include the license string itself. It just contains information about the licensed components. In case of TX Text Control (TXTextControl.TextControl), the following string is addded:
TXTextControl.TextControl, TXTextControl, Version=15.0.700.500, Culture=neutral, PublicKeyToken=6b83fe9a75cfb638
As you can see, it contains the namespace and control name, the assembly version, culture information and the unique public key token. Based on that information, the License Compiler (lc.exe) compiles the real license string that will be embedded into the executable assembly. The lc.exe is a small utility of the .NET Framework SDK which is used by Visual Studio during the build process.

What if I am using TX Text Control in a user control?
In this case, you need to add the license to the main executable as well. Therefore, you can simply drag and drop a TextControl to a dummy form of the main project, so that the licenses.licx file and the references are added automatically.
After that, you can remove the TextControl from that form again. Or you can simply copy or create a licenses.licx file to the main project folder. In this case, you need to add a reference to TX Text Control manually as well.
Related Posts
Getting Started: ServerTextControl and MailMerge in a .NET 8 Console…
This article shows how to create a .NET 8 console application on Linux using Docker and WSL that uses the ServerTextControl to create a document and MailMerge to merge JSON data into the document.…
Secure and Deploy .NET Windows Forms Apps with MSIX AppContainer Apps
This article shows how to secure and deploy .NET Windows Forms apps with MSIX AppContainer apps. MSIX is a Windows application packaging format that provides modern packaging for all Windows…
Encapsulating TX Text Control in Class Libraries
This article describes how to encapsulate TX Text Control in class libraries. This is useful if you want to use TX Text Control in multiple projects and you want to avoid code duplication.
Creating an ASP.NET Core Web App with Docker Support and GitHub Packages
This article shows how to create an ASP.NET Core Web App with Docker support. The TX Text Control NuGet packages are hosted on GitHub Packages to get restored during the build process.
TX Text Control 32.0 SP2 Licensing Changes: Say Goodbye to licenses.licx
TX Text Control 32.0 SP2 has been released. This service pack includes a new licensing mechanism for all .NET based versions of TX Text Control. This article gives an overview of the changes and…