Swashbuckle.WebApi: Swagger gives me HTTP Error 403.14 - Forbidden
I am trying to use Swagger with Web API. I am just using the “Azure API App” template from the ASP.NET 4.6 templates installed with Visual Studio, which includes the Swashbuckle.Core and the SwaggerConfig.cs. The API works fine (I am able to call it successfully), but if I try to go to “http://mybaseurl/swagger/”, I get this error:
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
It seems like Swagger is not getting loaded or something. Anyone else get this before? I can’t seem to get around this. Thank you, and please let me know if I can provide more details.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 15 (2 by maintainers)
Sharing this fix as well for “HTTP Error 403.14 - Forbidden” that worked for me:
Delete the .vs folder that contains the applicationhost.config file and restart Visual Studio before trying to use Swagger again.
If someone has this problem of “403.14 - Forbidden” when using “/swagger”, but the use of the full path “/swagger/ui/index” works. In my case, after having spent too much time looking for a solution and none worked, in the end the problem was simpler that I thought, I had a folder called swagger in the solution, when I changed the name to something else the problem was solved. I hope this can prevent someone’s headaches
just for sharing: for the HTTP Error 403.14 - Forbidden, either of these works for me:
but still not know the reason of 403 error
You can always specify the startup url and things should work properly.
Oke… really strange, I played a bit with switching hosted environments, from IIS Express to Local IIS and even self-hosted OWIN in a cmd prompt. Now back to IIS Express (another port!) and it suddenly works… I have no clue why it didn’t work before as it’s the same code…
@rago99 thanks, save my day