Adding a license check to a .NET desktop app is easy to underestimate. The first API call is usually the simple part. Production behavior is where the real work begins: product scoping, device activation, offline grace, license transfer, failed payments, and getting the key into the customer's hands.
I put together a .NET tutorial that treats licensing as a complete product flow rather than one IsValid check.
Install the client:
dotnet add package PermitCore.Client
Then validate the key against the application version and the exact product:
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);
Before shipping, I would test at least these cases in the packaged application:
- the correct license and product;
- a valid license for a different product;
- an expired or revoked license;
- a device over its activation limit;
- a temporary network failure while offline grace is available;
- releasing an activation and moving the license to another computer.
The tutorial also finishes the commercial side. You can create a matching Store product, use one-time or recurring Stripe pricing, and have checkout generate and email the license. PermitCore uses the vendor's Stripe account and takes 0% PermitCore commission.
That is the distinction I wanted when building it: developers can create the license, implement it, and sell the software without maintaining a separate checkout-to-license webhook system.
Full walkthrough
How to add license keys to a .NET application
This is still an early-stage startup and I would especially appreciate feedback from people who ship WPF, WinUI, Avalonia, MAUI, or other desktop applications. 🙂🚀
Top comments (0)