diff --git a/src/Swashbuckle.AspNetCore.Cli/HostingApplication.cs b/src/Swashbuckle.AspNetCore.Cli/HostingApplication.cs index 3d527172cc..914f39209f 100644 --- a/src/Swashbuckle.AspNetCore.Cli/HostingApplication.cs +++ b/src/Swashbuckle.AspNetCore.Cli/HostingApplication.cs @@ -88,9 +88,10 @@ void OnEntryPointExit(Exception exception) return services; } - catch (InvalidOperationException) + catch (InvalidOperationException ex) { - // We're unable to resolve the host, swallow the exception and return null + // We're unable to resolve the host, log the exception and return null + Console.Error.WriteLine(ex.ToString()); } return null;