PermitCore.Client
1.1.0
dotnet add package PermitCore.Client --version 1.1.0
NuGet\Install-Package PermitCore.Client -Version 1.1.0
<PackageReference Include="PermitCore.Client" Version="1.1.0" />
<PackageVersion Include="PermitCore.Client" Version="1.1.0" />
<PackageReference Include="PermitCore.Client" />
paket add PermitCore.Client --version 1.1.0
#r "nuget: PermitCore.Client, 1.1.0"
#:package PermitCore.Client@1.1.0
#addin nuget:?package=PermitCore.Client&version=1.1.0
#tool nuget:?package=PermitCore.Client&version=1.1.0
PermitCore.Client — Official .NET SDK
Official .NET client for PermitCore license management.
Installation
dotnet add package PermitCore.Client
Quick Start
using PermitCore;
var client = new PermitCoreClient("https://your-permitcore-instance.com");
// On every app launch — check if license is valid
var result = await client.ValidateAsync("PERMIT-XXXX-XXXX-XXXX-XXXX");
if (!result.IsValid)
{
Console.WriteLine($"Invalid: {result.Message}");
return;
}
Console.WriteLine($"Valid! Product: {result.ProductName}");
// Check feature flags
if (result.HasFeature("export"))
EnableExportFeature();
if (result.IsTrial)
Console.WriteLine($"Trial — {result.TrialDaysRemaining} days remaining");
// Warn if vendor's subscription is expiring
if (result.VendorWarning is not null)
ShowWarningDialog(result.VendorWarning);
Product scoping (added 1.1.0): Validate/Activate find a key purely by the key itself — by
default, any active key belonging to your tenant validates successfully, regardless of which of
your products it was actually issued for. If your app should only accept keys issued for this
product, either check result.ProductId yourself, or pass the optional expectedProductId
parameter and let the server reject a mismatch for you (result.ErrorCode == "WrongProduct"). Find
your product's ID in the Admin panel under Products (or on a license's own detail page).
Activation (first install)
// Call once when the customer first installs on a new device
// Auto-generates hardware fingerprint (HWID)
var result = await client.ActivateAsync("PERMIT-XXXX-XXXX-XXXX-XXXX");
// Or supply your own device identifier
var result = await client.ActivateAsync(
licenseKey: "PERMIT-XXXX-XXXX-XXXX-XXXX",
deviceId: PermitCoreClient.GetHardwareId(),
deviceName: Environment.MachineName,
expectedProductId: null); // optional — reject a key issued for a different product
Offline Mode
When the server is unreachable, the SDK automatically serves the last valid response from a local cache for offlineGraceDays days (configured per-license in PermitCore).
var result = await client.ValidateAsync("PERMIT-XXXX-XXXX-XXXX-XXXX");
if (result.IsOffline)
ShowStatusBar("Running in offline mode");
The cache is stored in %LOCALAPPDATA%/.permitcore_cache_{hash}.
Floating / Concurrent Licenses
// Check out a seat at app startup
var session = await client.CheckoutAsync("PERMIT-XXXX-XXXX-XXXX-XXXX");
if (!session.Success)
{
Console.WriteLine($"No seats available: {session.Message}");
return;
}
// Keep alive every 4 minutes (expires after 15 min without heartbeat)
using var timer = new Timer(async _ =>
await client.HeartbeatAsync(session.SessionToken!),
null, TimeSpan.FromMinutes(4), TimeSpan.FromMinutes(4));
// Release seat on exit
AppDomain.CurrentDomain.ProcessExit += async (_, _) =>
await client.CheckinAsync(session.SessionToken!);
Hardware ID
// Get the stable hardware fingerprint for this machine
string hwid = PermitCoreClient.GetHardwareId();
Configuration
var client = new PermitCoreClient(new PermitCoreOptions
{
BaseUrl = "https://your-permitcore-instance.com",
EnableOfflineCache = true, // default: true
});
Supported Targets
- .NET 6, 7, 8, 9
- .NET Standard 2.0
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.