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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jaydeep PatilRank #205 · 11.7K reputationPosted Nov 5, 2022, 1:22 AM EDT
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();
}