Licensing | ComponentOne
In This Topic
    Licensing Application through Website
    In This Topic

    To license your app through website, follow these steps:

    1. Visit https://www.grapecity.com/en/my-account/create-app-key.
      Note: You must create a GrapeCity account and login to access this web page.
    2. If you are generating a full license, select your ComponentOne Ultimate serial number from the Select License drop-down menu on the page. If you are generating a trial license, leave it selected as Evaluation.
      Note: You should have ComponentOne License to generate the runtime license.
    3. Select app type from the App Type drop-down based on the type of application that you are building.
    4. In the App Name textbox, enter the name of your application.
    5. Click the Generate APP KEY button. A runtime license will be generated in the form of a string contained within a class.
    6. Copy the license and complete the following steps to add it to your application.
      1. Open your application in Visual Studio.
      2. In the Solution Explorer, right click the project YourAppName.
      3. Select Add | New Item. The Add New Item dialog appears.
      4. Under installed templates, select Visual C# | Class.
      5. Set the name of the class as License.cs and click Add.
      6. In the class License.cs, replace the content with the copied runtime license key.
        public static class License
        {
             public const string Key = "Your Key";
        }
        
      7. Follow the given step for the specific platform you are working on.

        From the Solution Explorer, open Startup.cs and assign the key as per the requirement to it as shown below.

        C#
        Copy Code
        public void ConfigureServices(IServiceCollection services)
        {
             C1.Web.Mvc.LicenseManager.Key = License.Key;
             C1.Web.Mvc.Finance.LicenseManager.Key = License.Key
             C1.Web.Mvc.Sheet.LicenseManager.Key = License.Key
             C1.Web.Mvc.Viewer.LicenseManager.Key = License.Key
             C1.Web.Mvc.MultiRow.LicenseManager.Key = License.Key
             C1.Web.Mvc.Olap.LicenseManager.Key = License.Key
             C1.Web.Mvc.TransposedGrid.LicenseManager.Key = License.Key
        }
        

        From the Solution Explorer, open Startup.cs and assign the key to it as shown below.

        C#
        Copy Code
        public void ConfigureServices(IServiceCollection services)
        {
                C1.Web.Api.LicenseManager.Key = License.Key;
                services.AddMvc(); //To add Mvc services
        }
        

        From the Solution Explorer, open App.xaml.cs and set the runtime license, inside the constructor App() method as shown below.

        C#
        Copy Code
        C1.Xamarin.Forms.Core.LicenseManager.Key = License.Key;
        

        From the Solution Explorer, open the main initialization constructor for your app and set the runtime license as shown below.

        C#
        Copy Code
        C1.UWP.LicenseManager.Key = License.Key;
        

        From the Solution Explorer, open the main initialization constructor for your app and set the runtime license as shown below. In the following code, replace "XXX" with the service component's name. For example, DataEngine and TextParser.

        C#
        Copy Code
        C1.XXX.LicenseManager.Key = License.Key;