Integration examples for .NET applications: console/desktop, ASP.NET Core web API, and Blazor Server.
dotnet/
├── src/
│ └── LicenseManagerClient.cs # Shared HTTP client (reusable in any .NET app)
├── examples/
│ ├── ConsoleApp/ # Console/desktop app (WPF, WinForms, MAUI)
│ ├── AspNetCoreApi/ # ASP.NET Core minimal API
│ └── BlazorServer/ # Blazor Server with interactive UI
└── README.md
- .NET 8.0 SDK or later
- A running License Manager server with an External API key
cd examples/ConsoleApp
# Edit Program.cs with your credentials
dotnet runWorks for any desktop scenario: console apps, WPF, WinForms, or .NET MAUI. Use LicenseManagerClient directly.
cd examples/AspNetCoreApi
# Edit appsettings.json with your credentials
dotnet runEndpoints:
| Method | URL | Description |
|---|---|---|
| GET | /license/connection |
Test server connectivity |
| POST | /license/activate |
Activate a license |
| GET | /license/verify/{productId} |
Verify current license |
| POST | /license/deactivate/{productId} |
Deactivate license |
| POST | /license/update-check |
Check for updates |
| GET | /license/latest/{productId} |
Get latest version |
| POST | /license/update-download |
Download update file |
cd examples/BlazorServer
# Edit appsettings.json with your credentials
dotnet runOpens an interactive dashboard at https://localhost:5001 with forms for activation, verification, and update checking.
The shared LicenseManagerClient class in src/ can be used in any .NET project:
using LicenseManager;
var options = new LicenseManagerOptions
{
ServerUrl = "https://your-license-server.com",
ApiKey = "your-api-key",
ApplicationUrl = "https://your-app.com",
};
using var client = new LicenseManagerClient(options);
// Activate
var result = await client.ActivateLicenseAsync("PRODUCT_ID", "LICENSE-CODE", "Client Name");
if (result.IsActive)
Console.WriteLine("Licensed!");
// Verify (uses saved license file)
var verify = await client.VerifyLicenseAsync("PRODUCT_ID");
// Check for updates
var update = await client.CheckForUpdateAsync("PRODUCT_ID", "1.0.0");
if (update.UpdateAvailable)
Console.WriteLine($"New version: {update.Version}");All examples read from appsettings.json (web) or inline constants (console):
| Setting | Description |
|---|---|
ServerUrl |
License Manager server URL |
ApiKey |
External API key from admin panel |
ApplicationUrl |
Your app's URL (sent as X-API-URL header) |
IpAddress |
Optional IP (default: 127.0.0.1) |
Language |
Optional locale (default: en) |
LicenseFilePath |
Optional path for license data file |
All requests include these headers automatically:
Content-Type: application/json
X-API-KEY: {ApiKey}
X-API-URL: {ApplicationUrl}
X-API-IP: {IpAddress}
X-API-LANGUAGE: {Language}
MIT