Hi, @pfdk , In Asp.Net Core, Swagger is default used in development environment, Check the below code in program.cs
.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
If you want to use swagger not only in development environment, You just need to delete the If()
condition and use swagger middleware directly.
app.UseSwagger();
app.UseSwaggerUI();
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Xinran Shen