Merge pull request #1709 from DuendeSoftware/jmdc/license-summary-resolution

fix(is): LicenseUsageSummary resolution
This commit is contained in:
Joe DeCock 2025-01-08 12:28:55 -06:00 committed by GitHub
commit f6b1590bf1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -38,12 +38,19 @@ try
.ConfigureServices()
.ConfigurePipeline();
var usage = app.Services.GetRequiredService<LicenseUsageSummary>();
if (app.Environment.IsDevelopment())
{
app.Lifetime.ApplicationStopping.Register(() =>
{
var usage = app.Services.GetRequiredService<LicenseUsageSummary>();
Console.Write(Summary(usage));
{
Console.ReadKey();
}
});
}
app.Run();
Console.Write(Summary(usage));
Console.ReadKey();
}
catch (Exception ex)
{
@ -55,7 +62,7 @@ finally
Log.CloseAndFlush();
}
string Summary(LicenseUsageSummary usage)
static string Summary(LicenseUsageSummary usage)
{
var sb = new StringBuilder();
sb.AppendLine("IdentityServer Usage Summary:");
@ -67,4 +74,3 @@ string Summary(LicenseUsageSummary usage)
return sb.ToString();
}