diff --git a/aspnetcore/tutorials/web-api-help-pages-using-swagger.md b/aspnetcore/tutorials/web-api-help-pages-using-swagger.md index d12f0ba27a..dd62c57803 100644 --- a/aspnetcore/tutorials/web-api-help-pages-using-swagger.md +++ b/aspnetcore/tutorials/web-api-help-pages-using-swagger.md @@ -227,7 +227,7 @@ Configure Swagger to use the generated XML file. > [!NOTE] > For Linux or non-Windows operating systems, file names and paths can be case sensitive. So `ToDoApi.XML` would be found on Windows but not CentOS for example. -[!code-csharp[Main](../tutorials/web-api-help-pages-using-swagger/sample/src/TodoApi/Startup.cs?name=snippet_Configure&highlight=29,32)] +[!code-csharp[Main](../tutorials/web-api-help-pages-using-swagger/sample/src/TodoApi/Startup.cs?name=snippet_Configure&highlight=29,33)] In the code above, ApplicationBasePath gets the base path of the app, which is needed to set the full path to the XML comments. `TodoApi.xml` only works for this example, the name of the generated XML comments file is based on the name of your application. diff --git a/aspnetcore/tutorials/web-api-help-pages-using-swagger/sample/src/TodoApi/Startup.cs b/aspnetcore/tutorials/web-api-help-pages-using-swagger/sample/src/TodoApi/Startup.cs index 7237294fe3..ac032ec064 100644 --- a/aspnetcore/tutorials/web-api-help-pages-using-swagger/sample/src/TodoApi/Startup.cs +++ b/aspnetcore/tutorials/web-api-help-pages-using-swagger/sample/src/TodoApi/Startup.cs @@ -45,7 +45,8 @@ namespace TodoApi var basePath = PlatformServices.Default.Application.ApplicationBasePath; //Set the comments path for the swagger json and ui. - options.IncludeXmlComments(basePath + "\\TodoApi.xml"); + var xmlPath = Path.Combine(basePath, "TodoApi.xml"); + options.IncludeXmlComments(xmlPath); }); }