How do set my launch settings.json file for production environment to run on iis?
what changes I need to do for swagger ui display page on published version on iis?
How do set my launch settings.json file for production environment to run on iis?
what changes I need to do for swagger ui display page on published version on iis?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jaydeep PatilPosted Nov 5, 2022, 5:22 AM
If you can add this condition inside the startup.cs class then that will be working fine in a Production environment. Because by default there is an IsDevelopment() condition when we create an application and due to this swagger will not work on the production. to solve this simply add IsProduction() method to check production environment as I shown in below.
//Startup.cs class
//Configure the HTTP request pipeline.
if (app.Environment.IsProduction())
{
app.UseSwagger();
app.UseSwaggerUI();
}