From a32fbb4351679e4a8747e0b898557d904e7d798a Mon Sep 17 00:00:00 2001 From: BusyCoding Date: Sat, 12 May 2018 09:19:20 -0400 Subject: [PATCH] EF Migrations vs. Swashbuckle (#6380) * Update Startup.cs This sample causes a FileNotFoundException with Entity Framework Core Migrations - i.e. when executing "dotnet ef migrations add new", the GetEntryAssembly call returns "ef", and "ef.xml" does not exist in the build folder. * Update Startup.cs This sample causes a FileNotFoundException with Entity Framework Core Migrations - i.e. when executing "dotnet ef migrations add new", the GetEntryAssembly call returns "ef", and "ef.xml" does not exist in the build folder. --- .../samples/2.0/TodoApi.Swashbuckle/Startup.cs | 4 ++-- .../samples/2.1/TodoApi.Swashbuckle/Startup.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aspnetcore/tutorials/web-api-help-pages-using-swagger/samples/2.0/TodoApi.Swashbuckle/Startup.cs b/aspnetcore/tutorials/web-api-help-pages-using-swagger/samples/2.0/TodoApi.Swashbuckle/Startup.cs index 5efc33faa0..88017d87bf 100644 --- a/aspnetcore/tutorials/web-api-help-pages-using-swagger/samples/2.0/TodoApi.Swashbuckle/Startup.cs +++ b/aspnetcore/tutorials/web-api-help-pages-using-swagger/samples/2.0/TodoApi.Swashbuckle/Startup.cs @@ -41,7 +41,7 @@ namespace TodoApi }); // Set the comments path for the Swagger JSON and UI. - var xmlFile = $"{Assembly.GetEntryAssembly().GetName().Name}.xml"; + var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"; var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); c.IncludeXmlComments(xmlPath); }); @@ -67,4 +67,4 @@ namespace TodoApi } #endregion } -} \ No newline at end of file +} diff --git a/aspnetcore/tutorials/web-api-help-pages-using-swagger/samples/2.1/TodoApi.Swashbuckle/Startup.cs b/aspnetcore/tutorials/web-api-help-pages-using-swagger/samples/2.1/TodoApi.Swashbuckle/Startup.cs index 3b9ca88e4f..cf3e75ee95 100644 --- a/aspnetcore/tutorials/web-api-help-pages-using-swagger/samples/2.1/TodoApi.Swashbuckle/Startup.cs +++ b/aspnetcore/tutorials/web-api-help-pages-using-swagger/samples/2.1/TodoApi.Swashbuckle/Startup.cs @@ -43,7 +43,7 @@ namespace TodoApi }); // Set the comments path for the Swagger JSON and UI. - var xmlFile = $"{Assembly.GetEntryAssembly().GetName().Name}.xml"; + var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"; var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); c.IncludeXmlComments(xmlPath); }); @@ -69,4 +69,4 @@ namespace TodoApi } #endregion } -} \ No newline at end of file +}