We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customer requests access to license information at runtime.
In the customers case it seems they embed NServiceBus and want to present the license data in their UI.
We could expose an actual object representing the license but we could also expose the license blob of the loaded license.
The customer currently is using reflection to access the license info.
private string GetNServiceBusLicenseInfo() { const string nServiceBusCoreAssembyName = "NServiceBus.Core, Version = 5.0.0.0, Culture = neutral, PublicKeyToken = 9fc386479f8a226c"; var result = "There was an Error obtaining NServiceBus License Information."; try { var licenseManagerType = Type.GetType($"NServiceBus.Licensing.LicenseManager, {nServiceBusCoreAssembyName}"); var memberInfo = licenseManagerType?.GetField("license", BindingFlags.NonPublic | BindingFlags.Static); if (memberInfo != null) { var info = memberInfo.GetValue(null); var licenseType = Type.GetType($"Particular.Licensing.License, {nServiceBusCoreAssembyName}"); if (licenseType != null) { var expirationDate = licenseType.GetProperty("ExpirationDate").GetValue(info) as DateTime?; var licenseTypeInfo = licenseType.GetProperty("LicenseType").GetValue(info); result = $"License Type: {licenseTypeInfo}, Expiration Date: {expirationDate.Value.ToShortDateString()}"; } } } catch (Exception e) { _logger.Info(ErrorType.HealthCheckFailed, result, e); } return result; }
https://nservicebus.desk.com/agent/case/17833
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Customer requests access to license information at runtime.
In the customers case it seems they embed NServiceBus and want to present the license data in their UI.
We could expose an actual object representing the license but we could also expose the license blob of the loaded license.
Code
The customer currently is using reflection to access the license info.
Reference
https://nservicebus.desk.com/agent/case/17833
The text was updated successfully, but these errors were encountered: