LicenseException Class
- Namespace
TXTextControl.TXSheetControl. Server
- Package
TXTextControl.from the private NuGet feed or the supplied NuGet folderTXSheetControl. Server
- Assembly
TXTextControl.TXSheetControl. Api. dll
- Install
dotnet add package TXTextControl..NET 10 and later.TXSheetControl. Server
- Also in
TXTextControl.asTXSheetControl. Blazor TXTextControl.TXSheetControl. Api. dll
- Inherits
- Exception
- License
Exception
Offline licensing failure with the same stable code as the JavaScript API; never contains the token.
Syntax
public class LicenseException
Interfaces: ISerializable.
Members
Properties
| Property | Description |
|---|---|
| Code | Stable machine-readable licensing error. |
Examples
Convert an application-supplied workbook and return a structured failure to the caller. Missing or invalid licenses fail; configure a valid signed token before retrying.
using TXTextControl.TXSheetControl.Server;
async Task<(byte[]? Pdf, string? Error)> TryConvertInvoiceAsync(byte[] workbookBytes, string signedLicense)
{
try
{
await using var control = new ServerSheetControl(new ServerSheetControlOptions { License = signedLicense });
await control.LoadAsync(workbookBytes, StreamType.SpreadsheetML);
return (await control.SaveAsync(StreamType.PDF), null);
}
catch (LicenseException error)
{
return (null, error.Code + ": " + error.Message);
}
}