diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 5f485987c..79e407fa0 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -10,7 +10,7 @@ true git https://github.com/domaindrivendev/Swashbuckle.AspNetCore.git - 6.2.1 + 6.2.2 diff --git a/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIBuilderExtensions.cs b/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIBuilderExtensions.cs index e797f9cb4..38669b56e 100644 --- a/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIBuilderExtensions.cs +++ b/src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIBuilderExtensions.cs @@ -1,8 +1,13 @@ using System; +using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Swashbuckle.AspNetCore.SwaggerUI; +#if NETSTANDARD2_0 +using IWebHostEnvironment = Microsoft.AspNetCore.Hosting.IHostingEnvironment; +#endif + namespace Microsoft.AspNetCore.Builder { public static class SwaggerUIBuilderExtensions @@ -33,7 +38,6 @@ public static IApplicationBuilder UseSwaggerUI( if (options.ConfigObject.Urls == null) { var hostingEnv = app.ApplicationServices.GetRequiredService(); - options.ConfigObject.Urls = new[] { new UrlDescriptor { Name = $"{hostingEnv.ApplicationName} v1", Url = "v1/swagger.json" } }; }