Home:ALL Converter>Swagger UI not working with Swashbuckle latest version

Swagger UI not working with Swashbuckle latest version

Ask Time:2017-09-27T21:36:32         Author:devangi

Json Formatter

I am using Swashbuckle 5.3 version in my .NET Web API with Basic Authentication (as per this link). Now when I am trying to update with Swashbuckle 5.6 version, it's throwing error 'Key is not found'. The issue is at following code snippet. During route mapping, it's not able to find 'swagger_ui' from route collections. I tried with other different route values ( like 'swagger' , '/swagger','swagger/docs' ) but none of them is working

 var route = config.Routes["swagger_ui"];
        config.Routes.Remove("swagger_ui");
        config.Routes.MapHttpRoute("swagger_ui", route.RouteTemplate, route.Defaults, route.Constraints, new AuthMessageHandler(route.Handler));

Author:devangi,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/46449341/swagger-ui-not-working-with-swashbuckle-latest-version
yy