# How to protect a .NET Core app with QLM

Note that QLM support for .NET Core is currently in Beta. It will be officially released in Sept 2019 when .NET Core 3 will be released.

Please contact us to request access to the Beta release.

To protect a .NET Core app with QLM:

* Download the QLM .NET Core library (QlmLicenseLibNetCore.dll)
* In your .NET Core project:
  * Add a reference to QlmLicenseLibNetCore.dll
  * Add the following nuget packages:
    * System.Private.ServiceModel
    * System.Security.Cryptography.Xml
    * System.ServiceModel.Http
* From the QLM Management Console, generate a LicenseValidator class (C#)
* Add the LicenseValidator class your .NET Core project
* When your application is loaded, call the LicenseValidator.ValidateLicenseAtStartup function as shown in the code below (this is similar to a regular .NET 4.x project)

{% code overflow="wrap" %}

```csharp
ELicenseBinding licenseBinding = ELicenseBinding.ComputerName;

if (lv.ValidateLicenseAtStartup(licenseBinding, ref needsActivation, ref errorMsg) == false)
{
    DisplayLicenseForm();

    if (lv.ValidateLicenseAtStartup(licenseBinding, ref needsActivation, ref errorMsg) == false)
    {
        Environment.Exit(0);
    }
}

private int DisplayLicenseForm()
{
    string errorMessage;
    if (lv.QlmLicenseObject.ValidateSettingsFile(settingsFile, out errorMessage) == false)
    {
        MessageBox.Show(this, errorMessage, "QLM", MessageBoxButtons.OK, MessageBoxIcon.Error);
        return 0;
    }

    string args = String.Format("/settings \"{0}\"", settingsFile);

    int ret = lv.QlmLicenseObject.LaunchProcess(wizardExe, args, true, true);

    return ret;
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.soraco.co/docs/how-to/how-to-protect-a-.net-core-app-with-qlm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
