This article should help you, if you get the following error message in Visual Studio:

The following control could not be licensed: TXTextControl.TextControl

This means that .NET is not able to find an appropriate license to validate the control. Generally, the license will be automatically included into the application and typically, you don't have to worry about licensing at all. In case, you are dropping a TextControl object onto a Form, TX Text Control creates an entry in the licenses.licx file automatically.

However, should you wish to do one of the following, it is necessary to take a closer look at licensing:

  • Creating TextControl dynamically
  • Encapsulating TextControl in a user control
  • Updating an existing project with a newer version of TX Text Control

Creating TextControl Dynamically

Two significant steps are required in order to add the license of TX Text Control into an application. These steps must be performed when creating a TextControl instance dynamically:

  1. The project must include a reference to the used assembly (TXTextControl.dll and TXTextControl.Windows.Forms.dll, TXTextControl.Server.dll or TXTextControl.WPF.dll). To include the reference, select Add Reference... from the Project main menu in Visual Studio. Browse for the required assemblies, select them and confirm by clicking OK.

  2. A licenses.licx file must exist in the project. To build such a file, create a new text file in this folder and name it licenses.licx. Open the file and add one of the following strings, depending on which assembly you are using:

    Assembly Entry
    TXTextControl.WPF.TextControl TXTextControl.WPF.TextControl, TXTextControl.WPF
    TXTextControl.TextControl TXTextControl.TextControl, TXTextControl.Windows.Forms
    TXTextControl.ServerTextControl TXTextControl.ServerTextControl, TXTextControl.Server

    Set the Build Action to Embedded Resource.

The licenses.licx file is not a TX Text Control specific file, but a Visual Studio file that is used by lc.exe (which is part of the .NET SDK) to compile the licenses into the assembly.

Encapsulating TextControl in a User Control

If you wrap TextControl in a user control assembly, the license information must be in the calling application (exe). It is not enough that the user control contains a reference to TX Text Control core (TXTextControl.dll) and the specific platform assembly TXTextControl.Windows.Forms.dll, TXTextControl.Server.dll or TXTextControl.WPF.dll. The license must be compiled into the calling assembly.

Updating an Existing Project

Projects will be updated automatically, if only one version of TX Text Control is installed. If you have several versions of TX Text Control installed, perform the following steps:

  1. Load your Visual Studio .NET project.
  2. Open the Add Reference... dialog box in the Project... menu.
  3. Delete the reference to the current TX Text Control version.
  4. Add a reference to the new version and close the dialog box.
  5. Open the licenses.licx file of your project and change the version number of the referenced TX Text Control version to the version number of the newer TX Text Control version.
  6. Rebuild your project using the Rebuild Solution menu item.

Important: Do Not Change the Assembly Names After the Compilation

The license strings are embedded in the Resources section of the assemblies and if names are changed after the compilation, the licenses cannot be found anymore.