Licensing
A license problem shows up as an exception with a license message, most often when a window with a TextControl is opened or a control is created in code. How the license reaches an application depends on the project: .NET projects embed the license file of the NuGet package, and .NET Framework projects compile the entries of licenses.licx. The sections below start from the message you see. License Configuration explains how licensing works when everything is in place.
Check Which Edition Your Application Runs
Before you change anything, find out which edition the application uses: the Level of the VersionInfo that GetVersionInfo returns is Enterprise, Professional, Standard or Trial. Check the Edition at Run Time shows the code.
A Control Could Not Be Licensed
An exception starts with this message, followed by the name of the class, for example TXTextControl.TextControl:
The following control could not be licensed:
.NET didn't find a license that validates the control in the assembly it checks. By default, this is the executable assembly of the application. How to fix it depends on the kind of project.
.NET Projects
Since Service Pack 2 of version 32.0, .NET projects don't use licenses.licx or the license compiler. The package TXTextControl.TextControl.WPF.SDK adds the license file txtextcontrol.wpf.license to the project, and the build embeds it into your assembly.
- Make sure the project references
TXTextControl.TextControl.WPF.SDKfrom Text Control Offline Packages of a licensed setup or from the Text Control Private NuGet Feed. - Check that txtextcontrol.wpf.license is in the project with the build action Embedded Resource. Don't add the file yourself; the package adds it.
- Delete licenses.licx if the project still has one from an earlier version.
- Rebuild the application.
.NET Framework Projects
A .NET Framework project needs an entry for each licensed class in licenses.licx, and since version 30.0 each entry must contain the full version of the assembly the project references. A missing file, a missing entry or an entry without the right version causes this error.
- Add licenses.licx to the project, if it is missing, and set its build action to Embedded Resource.
- Add an entry for each class you use, with the version of the assemblies your project references, and rebuild the application.
.NET Framework: licenses.licx shows an entry and explains why the version is required, and the blog article Version 30.0: Changes in Licenses.licx the change of version 30.0.
The Error Occurs in a Class Library, User Control or Unit Test
The message of the previous section appears when TX Text Control runs in a class library or a user control that an application without a TX Text Control reference calls, or when NUnit or MSTest run your tests.
The license is checked in the executable assembly, which in these cases isn't the assembly that holds the license. Test frameworks use precompiled assemblies that can't be changed. Since Service Pack 2 of version 32.0, the static property EntryAssembly names the assembly with the license.
Set TextControl.EntryAssembly to the assembly that holds the license before the first
TextControlis created, for example in the constructor of a user control beforeInitializeComponent:TXTextControl.WPF.TextControl.EntryAssembly = typeof(MyUserControl).Assembly;If the library also uses
ServerTextControl, set ServerTextControl.EntryAssembly as well; each type of TX Text Control needs its own entry assembly.Rebuild the library and the application or test project that calls it.
Application Licensing describes the setting, and the blog article Unit Testing with NUnit and MSTest and TX Text Control .NET 34.0 shows it in tests.
The License Isn't Found After an Upgrade
After moving a .NET Framework project to a new version, the controls could not be licensed, while they worked before.
The entries of licenses.licx still name the version of the previous assemblies.
- Remove the references to the old assemblies and add those of the new version from the Assembly folder of the installation.
- Change the version in each entry of licenses.licx to the version of the new assemblies.
- Close Visual Studio, open the project again and choose Build > Rebuild Solution.
Upgrading from Previous Versions has the steps for .NET Framework and .NET projects.
The License Isn't Found After Renaming an Assembly
The application worked until you renamed its assembly after building it.
The compiled license belongs to the assembly it was compiled into. After a rename, the license can't be found.
- Change the name of the assembly in the project settings instead, and rebuild the application.
The Trial Version Has Expired
TX Text Control reports this message:
The Trial Version has expired.
The trial version is valid for 30 days.
- If you have a license, install the setup of the full version, reference its assemblies or package, and rebuild the application.
- If you need more time to evaluate, contact the Text Control sales team.
A Feature Isn't Available in Your Edition
A LicenseLevelException is thrown with one of these messages:
This feature is not available in the TX Text Control Standard version. At least the Professional version must be installed.
This feature is not available in the TX Text Control Standard or Professional version. The TX Text Control Enterprise version must be installed.
LicenseLevelException is thrown when your code uses a feature that the licensed edition doesn't contain.
- Check the edition of the application, as the first section shows.
- Check in Editions and Feature Availability which edition the feature needs.
- Use a feature of your edition, or license the edition that contains the feature.