Class License
Allows IronWord license keys to be applied globally across an application.
Inheritance
Namespace: IronWord
Assembly: IronWord.dll
Syntax
public static class License : Object
Licensing for an IronWord application is handled in one place through the static License class. Setting a license key here is what removes the trial watermark and unlocks the library for production, and a developer typically does it once at application startup before any document work begins.
Assign your key to LicenseKey to apply it for the rest of the process. IsLicensed reports, as a bool, whether a valid key is currently in effect, which is useful for an environment check or a startup assertion. IsValidLicense(string licenseKey) tests a candidate key without applying it, so you can validate a value pulled from configuration before committing to it. DisableAppAnalytics() opts the process out of anonymous usage analytics. Because every member is static, set the key as early as possible, before the first WordDocument is created, so the whole run is licensed.
using IronWord;
License.LicenseKey = "IRONWORD-MYKEY-1234";
bool licensed = License.IsLicensed;The Word to PDF how-to and the add text how-to show the document workflows that run once the key is set.
Properties
IsLicensed
Determines whether this instance of IronWord is Licensed.
Will return false unless a LicenseKey
is set to a valid trial or full license key in
LicenseKey property, Web.Config,
App.Config or appsettings.json in .Net Core.
See https://ironsoftware.com/csharp/word/licensing/ and https://ironsoftware.com/csharp/word/docs/license/license-keys/
Declaration
public static bool IsLicensed { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
LicenseKey
Get Licensed at https://ironsoftware.com/csharp/word/licensing/
For .Net framework applications, a license key can alternatively be
added to Web.Config or App.Config XML file using
<add key="IronWord.LicenseKey" value="IRONWORD-LICENSE-KEY"/>
within the appSettings node.
See https://ironsoftware.com/csharp/word/docs/license/license-keys/
For .Net Core applications, a license key may be added to
appsettings.json where the key name is "IronWord.LicenseKey"
and the value is a valid IronWord trial or full license key.
See https://ironsoftware.com/csharp/word/licensing/ for licensing options.
Declaration
public static string LicenseKey { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
DisableAppAnalytics()
Disables AppAnalytics for IronWord. Limitations apply.
Declaration
public static void DisableAppAnalytics()
IsValidLicense(String)
Determines whether a string license is valid upon the validation process
------------------------------------------------
Usage:
bool checkValidLicense = IronWord.License.IsValidLicense(IronWord.License.LicenseKey);
------------------------------------------------
Declaration
public static bool IsValidLicense(string licenseKey)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | licenseKey | IronWord license key as a string |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Remarks
Important Notes:
❗ Validation Behavior: This method will return false for expired keys, even if they were previously valid. This includes:
- Expired TEAM KEY
- Expired Subscription Key
- Expired Enterprise Key
🗝️ Get a Trial Key: Learn more and get a trial key
🗝️ Commercial Licensing: View commercial licensing options
📚 API Reference:Full API Documentation