All integration tutorials
.NETCreate → implement → sell

How to add license keys to a .NET application

Install the NuGet package, bind the first activation to a device, validate the correct product on startup, and sell the finished application without building a separate checkout.

0% PermitCore commission Your payment account Automatic license delivery
C# / .NET
NuGet
dotnet add package PermitCore.Client --version 2.1.1
using PermitCore;
using System.Reflection;

var client = new PermitCoreClient("https://api.permitcore.dev");
var version = Assembly.GetEntryAssembly()?.GetName().Version?.ToString() ?? "1.0.0";
var result = await client.ValidateAsync(
    licenseKey,
    version: version,
    expectedProductId: productId);

if (!result.IsValid)
    return ShowActivationWindow(result.Message);
One connected workflow

From product record to paid customer

Use PermitCore for the licensing layer and Store checkout. Verified paid evidence triggers the configured license issuance and queues the delivery email; test actual delivery before launch.

  1. 01
    Create

    Create the product and license policy

    In Products, create the software your key unlocks. Choose its activation limit, validity, offline grace period, version range, and feature flags.

    • Create the desktop product
    • Set activation and version limits
    • Choose an offline grace period
    • Copy the product ID
  2. 02
    Implement

    Install the .NET SDK and scope the key

    Put license activation in the first-run flow and validation at startup. Pass your product ID so a valid key for another product cannot unlock this one.

    These are application fragments: supply your own key/product variables and UI or host flow. A validation call does not register a device or reserve a floating session. Check failure before protected work. Offline use needs explicitly configured trusted public keys; follow the SDK 2.1.1 offline setup. For C++, use the vcpkg registry and pinned baseline in its installation reference, rather than assuming a built-in public port.

    dotnet add package PermitCore.Client --version 2.1.1
    • Activate on the first successful entry
    • Validate at application startup
    • Pass expectedProductId on every check
    • Use feature flags for paid capabilities
    Read the complete .NET SDK reference
  3. 03
    Verify

    Test the real validation path

    In .NET, productId is a Guid parsed from your configured product ID. The shown fragment performs online validation. For SDK 2.1.1 offline grace, first configure trusted public keys, a private cache directory and a stable device ID as described below. Test valid, revoked, expired and wrong-product states, then disconnected behavior after a valid signed proof has been cached.

  4. 04
    Sell

    Publish the product in your Store

    Connect your chosen Stripe, Paddle or Lemon Squeezy account, add the product to your branded PermitCore Store, and publish. Account credentials, matching catalog prices and signed webhook configuration are required. PermitCore processes the verified payment and handles Store license fulfillment.

    • Create the matching Store product
    • Use one-time or recurring pricing with your saved Store provider
    • Let checkout issue the license
    • Verify the customer's delivery email
    Follow the Store setup guide
    PermitCore branded Store showing software products ready to buy
    Verified payment triggers license issuance and the delivery email queue.
Before you ship

.NET production checklist

The sample is intentionally small. Add these safeguards before making licensing part of a paid release.

  • Store only the customer's license key on the device, never an Admin credential.
  • Handle WrongProduct separately from a malformed or revoked key.
  • Show a clear offline-grace state instead of treating it as a fresh online result.
  • Test activation release and transfer before shipping paid builds.
The complete commercial path

Stop at a working sale, not a working API call.

Create the license policy, ship the .NET integration, and give buyers a Store where they can purchase it.