I am building an application in asp.net core running in docker linux container. My application is running good in debug mode but when i tried to run it in release mode and postman it i am getting error as "FileNotFoundException: Could not find file '/app/AuthorAdmin.Command.API.XML'".
Please find my startup.cs file as below:
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new Info
{
Version = "v1",
Title = "Taxathand AuthorAdminAPI",
Description = "Taxathand AuthorAdminAPI",
TermsOfService = "None",
Contact = new Contact() { Name = "tax@hand Author", Email = "prteja@deloitte.com", Url = "" }
});
//Locate the XML file being generated by ASP.NET...
var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.XML";
var xmlPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, xmlFile);
//... and tell Swagger to use those XML comments.
c.IncludeXmlComments(xmlPath);
});
My project file code is as follows:
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>CommandStack\AuthorAdmin.Command.API\AuthorAdmin.Command.API.xml</DocumentationFile>
<NoWarn>1701;1702;1591</NoWarn>
<OutputPath>bin\Debug\netcoreapp2.2\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>bin\Release\netcoreapp2.2\</OutputPath>
<DocumentationFile>bin\Release\netcoreapp2.2\AuthorAdmin.Command.API.xml</DocumentationFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
I want to access api's in release mode similar to debug mode.