-
Notifications
You must be signed in to change notification settings - Fork 494
Swashbuckle - Swagger Docs #1802
-
Hi,
Does anybody know how to get Swashbuckle.AspNetCore working?
I set my ASPNETCORE_ENVIRONMENT to development, but I keep getting a 404 back from the server when I go to the swagger page.
/// <summary>
/// Configure the HTTP request pipeline
/// </summary>
/// <param name="app">The app builder</param>
/// <param name="env">The host environment</param>
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
Log.Logger.Information("Configuring");
Console.WriteLine("Configuring");
if (env.IsDevelopment())
{
Log.Logger.Warning("Loading Swagger...");
Console.WriteLine("Loading Swagger");
app.UseDeveloperExceptionPage();
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseExceptionHandler("/error");
app.UseHttpsRedirection();
app.UseAuthentication();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
[10:44:03 INF] Request starting null GET {url}/swagger/index.html - null 0
[10:44:03 INF] Request finished null GET {url}/swagger/index.html - 404 null null 87.1275ms
[10:44:03 INF] Request reached the end of the middleware pipeline without being handled by application code. Request path: GET {url}/swagger/index.html, Response status code: 404
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
Hello @abentley-technolog-ltd,
How are you setting ASPNETCORE_ENVIRONMENT? Can you confirm if there is no conflicting settings for the environment variable?
Please shed some light on how you are creating this application? Are you using any dotnet CLI template? For example if I use a serverless.AspNetCoreWebApp template, ASPNETCORE_ENVIRONMENT is set to Development by default inside launchSettings.json.
Regards,
Chaitanya
Beta Was this translation helpful? Give feedback.