Setting the NMath License Key

NMath license information is stored in a license key which must be found at runtime. When you purchase one or more developer seats of NMath, you will be issued a license key describing the terms of your license.

If no license key is found at runtime, a default evaluation license key is used which provides a free 30-day evaluation period for NMath on the current machine.

Three mechanisms are supported for setting your NMath license key:

  • by setting the NMATH_LICENSE_KEY environment variable
  • by setting the NMathLicenseKey configuration app setting
  • by programmatically setting the LicenseKey property on class NMathConfiguration

Settings are applied in that order, and resetting the license key takes precedent over any earlier values. For example, here the environment variable is used:

 > set NMATH_LICENSE_KEY="<your key here>"

This code uses an app config file:

<?xml version="1.0" encoding="utf-8" ?>
    <add key="NMathLicenseKey" value="<your key here>" />

And this code accomplishes the same thing programmatically:

NMathConfiguration.LicenseKey = "<your key here>";

Note 1: Setting your license key works the same way for development and deployment machines.

Note 2: If you forget to set your license key on a machine, your code NMath code will work initially, using the default evaluation license, but this license will expire in 30 days.

4 thoughts on “Setting the NMath License Key

  1. There’s no need for a license key during evaluation. NMath will work for 30 days. Contact support if you’ve run out of evaluation time or if it’s failing.

    – Trevor

Leave a Reply

Your email address will not be published. Required fields are marked *