Click here to Skip to main content
15,879,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using WebAPI, when I am locally running in system with postman it is working fine . But when I hosted on IIS on server and checking in postman it is showing internal server error .

Other observation some times it working and sometimes not working can anyone help in resolving the issue.

It was built with MVC and vs2013 and C#

What I have tried:

I have tried in local system with postman it is working fine but same is deployed on server it is not getting response.
Posted
Updated 22-Sep-20 20:32pm
Comments
F-ES Sitecore 23-Sep-20 6:00am    
What is the internal error?

1 solution

Based on what you share, I would look at the following to troubleshoot: Troubleshoot Web API2 apps that work in Visual Studio and fail on a production IIS server | Microsoft Docs[^]
 
Share this answer
 
Comments
Rajesh Yerramsetti 23-Sep-20 3:46am    
I have Async function in code is there any dependency when we host two web api's 1 is work at a time if one is down other service is working.

code snap:
[HttpPost]
public async Task<datatable> PendingCount(MAS_EMP_LOGIN objModel)
{
DataSet dsPendingCount = new DataSet();
dsPendingCount = await objBal.GetPendingCount(objModel);
if (dsPendingCount.Tables.Count == 0||dsPendingCount.Tables[0].Rows.Count == 0)
{
return DefaultDt("PendingCount", "0");
}
else
{
return dsPendingCount.Tables[0];
}
}

Response handler is

X-powered-by ASP.net inherited

Header info in Postman is

cache-control →no-cache
content-length →36
content-type →application/json; charset=utf-8
date →Wed, 23 Sep 2020 07:22:48 GMT
expires →-1
pragma →no-cache
server →Microsoft-IIS/8.5
x-aspnet-version →4.0.30319
x-powered-by →ASP.NET
Sandeep Mewara 23-Sep-20 3:52am    
Not too sure what you mean here in above question context. Seems like a different question - please open a new query with details on the issue please.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900