Base solution for your next web application
Open Closed

swagger does not working after host the app to iis #5502


User avatar
0
jehadk created

the error when trying to call swagger is: error 404 but when run the app debug mode using VS the swagger is working fine


5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Is it a Web.Host project? Is there a problem with the swagger function?

    Need more information. Such as the specific version of Zero, related error log

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Could you share the url you are trying to call ?

  • User Avatar
    0
    jehadk created

    <a class="postlink" href="http://localhost/BarznWeb.BarznWeb.Web.Mvc/swagger/">http://localhost/BarznWeb.BarznWeb.Web.Mvc/swagger/</a>

    or

    <a class="postlink" href="http://localhost/BarznWeb.BarznWeb.Web.Mvc/swagger/v1/swagger.json">http://localhost/BarznWeb.BarznWeb.Web. ... agger.json</a>

    But when run the VS on debug mode and call the web browser using the following link <a class="postlink" href="http://localhost:62114/swagger/">http://localhost:62114/swagger/</a> the swagger is working fine

  • User Avatar
    0
    ismcagdas created
    Support Team

    Does it work for you if you host your app as a seperate website instead of a sub-website ? I mean if you create a new website on IIS and give it a port (8888 for example) and access the swagger-ui like <a class="postlink" href="http://localhost:8888/swagger/">http://localhost:8888/swagger/</a> ?

  • User Avatar
    0
    alper created
    Support Team

    to understand if the issue is related with your swagger config, just put a text file like "dummy.txt" in your root folder of the web app and try to download it.

    http://localhost:8888/dummy.txt
    

    we can figure out the issue after you do that