---
title: "Applying the License Key"
canonical_url: "https://www.compdf.com/guides/generation-sdk/dotnet-core/apply-the-license-key"
md_url: "https://www.compdf.com/guides/generation-sdk/dotnet-core/apply-the-license-key.md"
description: "ComPDF SDK Guides. In this developer's guide, all the details and how to use ComPDF for SDK Guides will be covered in depth."
---

# Applying the License Key

If you haven't obtained a license key yet, please refer to [How to Obtain a License Key](https://www.compdf.com/guides/generation-sdk/dotnet-core/requirements#obtaining-a-license-key).

## Copying the License Key

After obtaining the license key, apply it to your project according to the following steps.

1.  In the email you received, find the `XML` file containing the license key.
2.  Open the `XML` file.

**Offline License:**

```xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<license version="1">
<platform>windows</platform>
<starttime>xxxxxxxx</starttime>
<endtime>xxxxxxxx</endtime>
<key>LICENSE_KEY</key>
</license>
```

3.  Copy the **LICENSE\_KEY** in the `<key>LICENSE_KEY</key>` field.

## Applying the License Key

You can authenticate in the following way:

```csharp
public static bool LicenseVerify()
{
    if (!CPDFGeneration.LoadNativeLibrary())
        return false;
    
    LicenseErrorCode errorCode = CPDFGeneration.LicenseVerify("Input your license here");
    return (verifyResult == LicenseErrorCode.LICENSE_SUCCESS);
}
```
