When using Postman with this GET
localhost:28760/api/MotorCashiering
I was able to get the Status 200OK. But, after deploying to to my server (IIS) using this url:
mysite/api/MotorCashiering
I get the 500 error. Can someone shed light to this error? Thanks a lot.

Jes SiePosted Oct 13, 2023, 4:40 AM
I finally found the answer to my problem. I should install ASP.NET CORE hosting bundle. After I installed, I was able to get 200 OK status.
https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-aspnetcore-3.1.32-windows-hosting-bundle-installer
Jes SiePosted Oct 13, 2023, 3:56 AM
Thanks Naimish. I will try all your suggestions.
Naimish MakwanaPosted Oct 12, 2023, 4:48 AM
A 500 Internal Server Error is a generic error message that indicates something has gone wrong on the server, but it doesn't provide specific information about the root cause of the problem. To troubleshoot and resolve this issue, you'll need to do some investigation. Here are some steps you can follow to shed light on the error:
Check Server Logs: The server logs, such as the Windows Event Viewer or IIS logs, can provide more detailed information about the error. Look for the error entry corresponding to the time of the 500 error and examine the details. This might give you clues about what went wrong.
ASP.NET Configuration: Ensure that your application and API are configured correctly in IIS. Check the following:
Application Debugging: If your application is throwing an unhandled exception, it can result in a 500 error. You should add proper exception handling in your C# code to log errors and understand what's happening. You can use tools like
try-catchblocks or a logging framework to capture errors and debug your application.Permissions and Security: Ensure that your application has the necessary permissions to access resources it requires. Check folder and file permissions, database connections, and any external services your API is interacting with.
Dependency Errors: If your application relies on external libraries, make sure they are correctly installed and referenced. An issue with a missing or mismatched dependency can lead to a 500 error.
Custom Error Pages: Check if you have custom error handling configured in your web application. It might be redirecting error pages or returning a generic error message instead of detailed information.
Web.config: Review your web.config file for any misconfigurations. An invalid configuration setting can cause a 500 error.
Firewalls and Security Software: Ensure that there are no firewalls or security software blocking requests to your API. Sometimes, security software can interfere with requests to the server.
Database Connectivity: If your API connects to a database, verify that the database connection string is correctly configured and that the database server is accessible.
Try a Different Client: Sometimes, certain client applications (like Postman) handle requests differently than a browser. Try accessing your API from different clients to see if the behavior is consistent.
By following these steps and investigating the specific error details in the logs, you should be able to pinpoint the issue and resolve the 500 Internal Server Error when deploying your RESTful API to IIS.