Can you guess what exactly could be wrong with my scenario? Let me mention one more funny thing, if I click on 'Browse' for the 'DefaultWebSite' it doesn't open the default welcome page of IIS instead lists the directories. Is my IIS Installation corrupted? Hoping not!
That's expected since you enabled Directory Browsing and you are using a browser to navigate a Web API which does not have a user interface.
That's least of my concerns. I want to know, what needs to be done so that Scalar Documentation page opens when I 'Browse' my configured 9.0 webAPI. Give me some hints.
What do you expect to see? If you are expecting Open API then make sure your configuration is setup to show Open API outside the development environment.
Change this...
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
To this...
app.UseSwagger();
app.UseSwaggerUI();
Or this...
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
}
To this...
app.MapOpenApi();
If you are expecting a default API action then set the expected action or controller as the root route. See the official docs.
https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing?view=aspnetcore-9.0
If you are expecting something else then explain what you are trying to do.