diff --git a/aspnetcore/tutorials/web-api-help-pages-using-swagger.md b/aspnetcore/tutorials/web-api-help-pages-using-swagger.md index 40c7efdbf4..b31841bde4 100644 --- a/aspnetcore/tutorials/web-api-help-pages-using-swagger.md +++ b/aspnetcore/tutorials/web-api-help-pages-using-swagger.md @@ -223,6 +223,8 @@ See Visual Studio Code. --- +Enabling XML comments provides debug information for undocumented public types and members. Undocumented types and members are indicated by the warning message: *Missing XML comment for publicly visible type or member*. + Configure Swagger to use the generated XML file. For Linux or non-Windows operating systems, file names and paths can be case sensitive. For example, a *ToDoApi.XML* file would be found on Windows but not CentOS. [!code-csharp[Main](../tutorials/web-api-help-pages-using-swagger/sample/TodoApi/Startup.cs?name=snippet_ConfigureServices&highlight=20-22)] diff --git a/aspnetcore/tutorials/web-api-help-pages-using-swagger/sample/TodoApi/Startup.cs b/aspnetcore/tutorials/web-api-help-pages-using-swagger/sample/TodoApi/Startup.cs index e15e969ff7..34ac118f0f 100644 --- a/aspnetcore/tutorials/web-api-help-pages-using-swagger/sample/TodoApi/Startup.cs +++ b/aspnetcore/tutorials/web-api-help-pages-using-swagger/sample/TodoApi/Startup.cs @@ -1,4 +1,5 @@ -using System.IO; +using System; +using System.IO; using Microsoft.AspNetCore.Builder; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; @@ -9,7 +10,7 @@ using TodoApi.Models; namespace TodoApi { public class Startup - { + { #region snippet_ConfigureServices public void ConfigureServices(IServiceCollection services) { @@ -30,9 +31,9 @@ namespace TodoApi }); // Set the comments path for the Swagger JSON and UI. - var basePath = PlatformServices.Default.Application.ApplicationBasePath; + var basePath = AppContext.BaseDirectory; var xmlPath = Path.Combine(basePath, "TodoApi.xml"); - c.IncludeXmlComments(xmlPath); + c.IncludeXmlComments(xmlPath); }); } #endregion