diff --git a/hosts/main/Program.cs b/hosts/main/Program.cs index 27ca14d6b..dc8d2b51b 100644 --- a/hosts/main/Program.cs +++ b/hosts/main/Program.cs @@ -38,12 +38,17 @@ try .ConfigureServices() .ConfigurePipeline(); - app.Lifetime.ApplicationStopping.Register(() => + if (app.Environment.IsDevelopment()) { - var usage = app.Services.GetRequiredService(); - Console.Write(Summary(usage)); - Console.ReadKey(); - }); + app.Lifetime.ApplicationStopping.Register(() => + { + var usage = app.Services.GetRequiredService(); + Console.Write(Summary(usage)); + { + Console.ReadKey(); + } + }); + } app.Run(); }