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.
pull/6388/head
BusyCoding 2018-05-12 09:19:20 -04:00 committed by Scott Addie
parent 2d616b9bd3
commit a32fbb4351
2 changed files with 4 additions and 4 deletions

View File

@ -41,7 +41,7 @@ namespace TodoApi
}); });
// Set the comments path for the Swagger JSON and UI. // 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); var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
c.IncludeXmlComments(xmlPath); c.IncludeXmlComments(xmlPath);
}); });
@ -67,4 +67,4 @@ namespace TodoApi
} }
#endregion #endregion
} }
} }

View File

@ -43,7 +43,7 @@ namespace TodoApi
}); });
// Set the comments path for the Swagger JSON and UI. // 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); var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
c.IncludeXmlComments(xmlPath); c.IncludeXmlComments(xmlPath);
}); });
@ -69,4 +69,4 @@ namespace TodoApi
} }
#endregion #endregion
} }
} }