Asp.Net Core API published. Default page getting 500 error but Weatherforcast api working in Postman.

Jithesh k r 26 Reputation points
2022-02-11T05:05:45.03+00:00

Asp.Net Core Api published in IIS.
default page swagger/index.html not working and Login modules not working. but Weatherforcast api working in Postman. Please help.

Developer technologies | ASP.NET | ASP.NET Core
{count} votes

Answer accepted by question author
  1. Rijwan Ansari 766 Reputation points MVP
    2022-02-11T09:00:58.247+00:00

    Hi @Jithesh k r

    I think this is because of environment.

    // Configure the HTTP request pipeline.  
    if (app.Environment.IsDevelopment())  
    {  
        app.UseSwagger();  
        app.UseSwaggerUI();  
    }  
    

    You can keep swagger UI call outside of development environment.

    Try this way and check

    // Configure the HTTP request pipeline.  
    if (app.Environment.IsDevelopment())  
    {  
          
    }  
    app.UseSwagger();  
    app.UseSwaggerUI();  
    
    0 comments No comments

9 additional answers

Sort by: Most helpful
  1. Jithesh k r 26 Reputation points
    2022-02-11T11:04:22.363+00:00

    Hi @Rijwan Ansari thanks your support.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.