Connect any C# application
Use the same workflow for desktop, web, console, and service applications.
Create an application and installation
- Open Applications and create the software product once.
- Open Installations and add one entry for each computer, server, or station controlled independently.
- Download the installation's setup ZIP package.
- Extract the ZIP into the client application folder.
Setup ZIP package contents
hwcommx-license.json— application and station identity, check interval, and remote URL.License/hwcommx-license.lic— an initial signed license for the first startup without internet access.License/public-key.xmlandpublic-key.pem— public keys used for verification.README.txt— installation-specific instructions.
The remote endpoint is generated automatically as /licenses/{licenseId}.json.
Use HWCommX.Licensing.Client
Add the HWCommX.Licensing.Client NuGet package, then check the license before running protected business functionality.
using HWCommX.Licensing.Client;
using var licensing = LicenseClient.FromDirectory(
AppContext.BaseDirectory,
expectations: new LicenseClientExpectations
{
ApplicationCode = "SECAR",
StationCode = "DEFAULT"
});
var result = await licensing.CheckAsync();
if (!result.IsAllowed)
{
// Stop or disable only the protected functionality.
throw new InvalidOperationException(result.Message);
}
ApplicationCode must be defined in the source code. StationCode may come from trusted configuration when one build serves multiple stations. Do not hard-code LicenseId; it is unique to each installation and supplied by the setup package.
The same package supports WinForms, WPF, console applications, Windows Services, ASP.NET Core, Worker Services, and compatible ASP.NET Web Forms projects.
Remote locking with offline support
- Unlock: the next online check returns a signed active license.
- Lock: the next online check returns a signed inactive license.
- No internet: the client can use its last verified license until the offline grace period expires.
- Invalid file: modified or mismatched licenses are rejected because the signature, application code, station, and license ID are verified.
Update the client package
Build the NuGet package with a higher version, update the package reference in the client project, test it, and publish again. Existing installation ZIPs do not need to be regenerated unless the identity or server URL changes.