I can't understand how to teach to the web api and IIS to open the default page index.html of Swagger when navigate into. I'd like to redirect the default WebApi page to Swagger.
The WebApi is into "Default Web Site".
I tried the following:
if (app.Environment.IsDevelopment())
{
app.UseSwaggerUI();
}
else if (app.Environment.IsProduction())
{
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1.0/swagger.json", "v1.0");
options.RoutePrefix = "api/swagger";
});
}
IIS open the default "https://localhost/WebApi" showing
{"Message":"Value cannot be null. (Parameter \u0027key\u0027)","StatusCode":500}
Any suggestions?
Thanks