builder.Services.AddApiVersioning(config =>
{
config.DefaultApiVersion = new ApiVersion(1, 0);
config.AssumeDefaultVersionWhenUnspecified = true;
config.ReportApiVersions = true;
});
builder.Services.ConfigureOptions<ConfigureSwaggerOptions>();
if (app.Environment.IsDevelopment() || app.Environment.IsProduction())
{
app.UseSwagger();
app.UseSwaggerUI(options =>
{
var apiVersionDescriptionProvider = app.Services.GetRequiredService<IApiVersionDescriptionProvider>();
foreach (var description in apiVersionDescriptionProvider.ApiVersionDescriptions)
{
options.SwaggerEndpoint($"/swagger/{description.GroupName}/swagger.json", description.GroupName.ToUpperInvariant());
}
});
}
Has anyone worked with an Asp.net Core Web API project implementing API versioning in .Net 8.0 and successfully deployed it in IIS?

Kesava Subhash Gullapudi
30
Reputation points
I've implemented API versioning using Asp.Net Core web API in .Net 8.0 Framework, and it works fine in the debugger with Swagger. But when I deploy my application using IIS, I get an error page saying "Page can't be found". How can I resolve this issue?
Windows development Internet Information Services
1,745 questions
Developer technologies ASP.NET ASP.NET Core
4,815 questions
1 answer
Sort by: Most helpful
-
Kesava Subhash Gullapudi 30 Reputation points
2024-02-12T06:56:41.1966667+00:00