Search code examples
asp.net-core.net-coreasp.net-core-2.0iis-10

“500 - Internal server error” when calling ASP .Net Core 2.1.7 micro-service on Windows Server


I have ASP.Net Core based micro-service, which is deployed on IIS10 running Windows 10 enterprise.

enter image description here This application running all fine in all lower environments (Dev, QA) the moment i try to test it in UAT it start throwing

enter image description here

I validated the logs and it says 500 nothing else. Inside IIS logs it says 500 0 0 nothing else.

I tried enabling Details Logs, tried running in Development mode as below still no details getting printed :( I even tried it running from Command prompt same limited error 500.

Application internally call another service which is also running on same machine and when I hit that standalone that is working. This is exact same code and configs working fine in QA.

enter image description here

<?xml version="1.0" encoding="utf-8"?>
<configuration>
 <system.webServer>
   <handlers>
     <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
   </handlers>
   <aspNetCore processPath="dotnet" arguments=".\Communications.Api.dll" forwardWindowsAuthToken="false" stdoutLogEnabled="true" startupTimeLimit="3600" requestTimeout="23:00:00" stdoutLogFile=".\logs\stdout">
     <environmentVariables>
           <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
     </environmentVariables>
    <handlerSettings>
        <handlerSetting name="debugLevel" value="file" />
        <handlerSetting name="debugFile" value="D:\Communications\logs\ancm.log" />
 </handlerSettings>
   </aspNetCore>
   <security>
     <requestFiltering>
       <requestLimits maxAllowedContentLength="700000000" />
     </requestFiltering>
   </security>
    <httpErrors errorMode="Detailed" />
 </system.webServer>
     <system.web>
       <customErrors mode="Off" />
       <compilation debug="true" />
   </system.web>
</configuration>

How to get details to know real issue :( Please guide.


Solution

  • Here is the Solution for this issue.

    There is some configuration difference between QA and UAT.

    The moment I changed URLs to localhost, it started working.