问题
After installing the Swashbuckle.AspNetCore in my Asp.net Core (MVC) application the default route is override with "index.html" page.
Where ever I used "~/" now is redirecting my application to "~/index.html" instead of default MVC route.
How i can fix this?
回答1:
I had encountered this issue after setting the route prefix of swagger to root i.e.
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "LMW Valuer API V1");
c.RoutePrefix = string.Empty;
});
Even after removing the route prefix, I was still being redirected to index.html.
To solve my issue I has to clear the browser cache for my site.
Hope this helps.
来源:https://stackoverflow.com/questions/54448639/aspnet-core-2-2-default-route-changed-to-index-html-after-installing-swashbu