Skip To Content

License your app

In this topic

With a developer account, you can download and install an ArcGIS Runtime SDK and immediately have access to all of the functionality in the API for development and testing purposes. However, any map in your app will be watermarked (as pictured below) and debug messages will appear saying that your app is licensed for developer use only.

Runtime watermark

To deploy an app, you must license it at either the Basic or Standard level. When deploying Runtime technology, costs are incurred only at the Standard level. Usage of ArcGIS Online services may also incur costs. For details, see Terms of Use - FAQ and Plans. For an overview of the current ArcGIS Runtime licensing model, see Licensing your Runtime app.

License your app for deployment by adding a few lines of code, as described in the following sections. After this is done, the watermark and debug messages will no longer display and your app is ready to be deployed.

The following table shows which functionality will work for each license level:

License levelAvailable functionality

Developer (development and testing only)

All functionality (watermarks and debug messages will be generated)

Basic

All functionality except:

  • Local locators (geocoding)
  • Local routing
  • Local editing (such as geodatabase editing)
  • Local geodatabase sync operations with an upload
  • Local Server

Standard

All functionality

License your app at the Basic level

  1. Read the end user license agreement.
  2. Go to developers.arcgis.com and sign into your ArcGIS for Developers account.
    Note:

    If you do not have access to an ArcGIS for Developers account then you can obtain a client ID by contacting the Esri office that serves you. If you're in the United States, call Esri at 1-800-447-9778. Then skip to Step 5.

  3. Once you're logged in, the Applications section displays. If you haven’t already done so, register your app by clicking the Register New Application button. On the page that displays, complete the fields, then click Register New Application.

    In the page that displays, a client ID appears for your app.

  4. Copy the client ID.
  5. Use the following code to set the client ID in your app in a location in your project that comes before any ArcGIS Runtime functionality is used:

    Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.ClientId = "mYcLieNTid";

    After setting the ClientId property, initialize the runtime by calling the static Initialize method on the ArcGISRuntimeEnvironment class. Make sure to wrap the call in a try/catch block as shown below. If the initialization fails because of an invalid client ID, an exception will be thrown.

    Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.ClientId = "mYcLieNTid";
    
    try
    {
        Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.Initialize();
    }
    catch (Exception ex)
    {
        Console.WriteLine("Unable to initialize the ArcGIS Runtime with the client ID provided: " + ex.Message);
    }

Your app is now licensed at the Basic level for deployment.

License your app at the Standard level

You can license your app at the Standard level in one of two ways:

Use ArcGIS Online or Portal for ArcGIS to license your app

Users of your app can unlock its Standard level functionality for up to 30 days by authenticating with their organizational account on ArcGIS Online or with their Portal for ArcGIS. The app will then work in a disconnected mode for up to 30 days. Follow these steps to license your app this way:

  1. Obtain and set the client ID for your app by following all of the Basic level licensing steps.
  2. Allow the app user to authenticate with ArcGIS Online or Portal for ArcGIS. You must do this before any Standard level ArcGIS Runtime functionality is used. As part of the process, save the license information in preparation for your app being used in an offline environment for up to 30 days. This is achieved as follows:

    // connect to ArcGIS Online or an ArcGIS portal as a named user
    // The code below shows the use of token based security but you may consider using OAuth authentication
    try
    {
        // exception will be thrown here if bad credential ...
        var cred = await Esri.ArcGISRuntime.Security.IdentityManager.Current.GenerateCredentialAsync(
            PORTAL_SERVER_URL, UserTextBox.Text, PasswordTextBox.Password);
    
        // add the credential if it was generated successfully
        Esri.ArcGISRuntime.Security.IdentityManager.Current.AddCredential(cred);
    
        // identity manager will automatically include an available credential when connecting (based on the server URL)
        _portal = await Esri.ArcGISRuntime.Portal.ArcGISPortal.CreateAsync(new Uri(PORTAL_SERVER_URL));
    }
    catch(ArcGISWebException webExp)
    {
        var msg = "Could not log in. Please check credentials. Error code: " + webExp.Code;
    var messageDlg = new MessageDialog(msg);
    await messageDlg.ShowAsync();
    }
    
    // once connected, get the license info from the portal for the current user
    var licenseInfo = _portal.ArcGISPortalInfo.LicenseInfo;
    
    // set the license using the static ArcGISRuntimeEnvironment class
    Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.License.SetLicense(licenseInfo);
    
    // get a JSON representation of the license info
    var licenseJSON = licenseInfo.ToJson();
    
    // ... code here to save JSON license string locally ...

  3. If you saved the license information on local storage, your app can be started in an offline environment. You need to license your app with the following code:

    try
    {
        // set the client ID and initialize the ArcGIS Runtime
        Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.ClientId = "mYcLieNTid";
        Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.Initialize();
    }
    catch (Exception ex)
    {
        Console.WriteLine("Unable to initialize the ArcGIS Runtime with the provided client ID: " + ex.Message);
    }
    
    try
    {
        // read the saved license string from a local source (file on disk, e.g.)
        var licenseJSON = this.GetSavedLicenseString();
    
        // use the static FromJson method on LicenseInfo to create the license
        var localLicenseInfo = Esri.ArcGISRuntime.LicenseInfo.FromJson(licenseJSON);
    
        // set the license
        Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.License.SetLicense(localLicenseInfo);
    }
    catch (Esri.ArcGISRuntime.LicenseException ex)
    {
        Console.WriteLine("Unable to license the ArcGIS Runtime with the license string provided: " + ex.Message);
    }

  4. The saved license information will allow your app to be used offline for a period of 30 days, after which the license information will expire. The app must reconnect to ArcGIS Online or Portal for ArcGIS for new license information to be obtained and a new 30 day period to start. If an app attempts to use expired license information, it will only function with Basic level functionality.

Your app is now licensed for deployment with Standard functionality, including Local Server. Local Server extensions are however not available for named users of ArcGIS Online or Portal for ArcGIS. You can only use these extensions with a license code, as described below.

Use a license code to license your app

  1. Obtain and set the client ID for your app by following all of the Basic level licensing steps.
  2. Obtain a license code by contacting the Esri office that serves you. You can also obtain a client ID from this Esri office if you don't have access to an ArcGIS for Developers account. If you're in the United States, call Esri at 1-800-447-9778. Note that each Extension license is a separate license code. To use an Extension license you must have a Standard license.
  3. Using the following code sample, set the license code in your app after you set the client ID and before any ArcGIS Runtime functionality is used:

    try
    {
        // set the client ID and initialize the ArcGIS Runtime
        Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.ClientId = "mYcLieNTid";
        Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.Initialize();
    }
    catch (Exception ex)
    {
        Console.WriteLine("Unable to initialize the ArcGIS Runtime with the provided client ID: " + ex.Message);
    }
    
    try
    {
        // use the license code to enable standard level functionality
        Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.License.SetLicense("runtimestandard,101,rux00000,none,XXXXXXX"); 
    }
    catch (Esri.ArcGISRuntime.LicenseException ex)
    {
        Console.WriteLine("Unable to license the ArcGIS Runtime with the license string provided: " + ex.Message);
    }

  4. If your app requires functionality provided by Local Server extensions, you'll need to specify their licenses as the second parameter of the SetLicense method. The following example shows a license code being applied (first argument) followed by codes for all extensions:

    Esri.ArcGISRuntime.ArcGISRuntimeEnvironment.License.SetLicense(
        "runtimestandard,101,rux00000,none, XXXXXXX",
        "runtimespatial,101,rux00000,none, XXXXXXX",
        "runtimenetwork,101,rux00000,none, XXXXXXX",
        "runtime3d,101,rux00000,none, XXXXXXX");

Your app will now function offline or online with Standard functionality, including any Local Server extensions you’ve provided license codes for, without any time limitations.

Attribute Esri in your app

You are required to attribute Esri in your app using the following guidelines:

  • About and Credit screens must include the following text: "Mapping API provided by Esri ArcGIS Runtime SDK for .NET".
  • Map data—All map data used in an application must be attributed in About and Credit screens using the Copyright Text section of the REST endpoint(s) being used. For example, ESRI_Imagery_World_2D service must use Copyright:© 2013 ESRI, i-cubed, GeoEye.
  • Esri logo—If your application uses data served by Esri through ArcGIS Online, you must display a logo on the map. For examples of such data, see this ArcGIS Online page.

Related topics