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.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,180 questions
{count} votes

Accepted answer
  1. Rijwan Ansari 746 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: Newest
  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

  2. Jithesh k r 26 Reputation points
    2022-02-11T10:49:56.877+00:00

    thanks. resolved the issue.
    I used the connection string as Integrated secuity = True. When I changed to Sql Authentication, it's worked.
    Once again thanks..

    1 person found this answer helpful.

  3. Rijwan Ansari 746 Reputation points MVP
    2022-02-11T10:29:18.827+00:00

    You can check IIS log for more details

    173522-image.png

    Additinally, ASP.NET exceptions in Window Event Viewer

    173450-image.png

    0 comments No comments

  4. Jithesh k r 26 Reputation points
    2022-02-11T10:24:50.533+00:00

    Hi @Rijwan Ansari , the application is working through visual studio. but iis showing the 500 error. Where I can find the error log.

    0 comments No comments