public void Invoke(ReceivePhysicalMessageContext context, Action next) { context.PhysicalMessage.Headers[Headers.HasLicenseExpired] = LicenseExpired.ToString().ToLower(); next(); if (Debugger.IsAttached) { if (LicenseManager.HasLicenseExpired()) { Log.Error("Your license has expired"); } } }
public void Init() { var expiredLicense = true; try { LicenseManager.InitializeLicense(); expiredLicense = LicenseManager.HasLicenseExpired(); } catch (Exception ex) { //we only log here to prevent licensing issue to abort startup and cause production outages Logger.Fatal("Failed to initialize the license", ex); } Configure.Component <LicenseBehavior>(DependencyLifecycle.InstancePerCall) .ConfigureProperty(p => p.LicenseExpired, expiredLicense); }