title: ASP.NET Core API - 500 internal server error,only on production
body: <p>I've developed an ASP.NET WebApi application.
  When I publish and test it to localhost IIS,I got this error at one request:</p>
  
  <pre><code>   Response with status: 500 Internal Server Error for URL: 
  http://localhost/api/COMI/NEW/158/3
  </code></pre>
  
  <p>web.config:</p>
  
  <pre><code>      &lt;?xml version="1.0" encoding="utf-8"?&gt;
          &lt;configuration&gt;
            &lt;system.webServer&gt;
              &lt;handlers&gt;
                &lt;add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" 
      resourceType="Unspecified" /&gt;
              &lt;/handlers&gt;
              &lt;aspNetCore processPath="dotnet" arguments=".\POSweb.dll" 
  stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" /&gt;
            &lt;/system.webServer&gt;
          &lt;/configuration&gt;
          &lt;!--ProjectGuid: 5f28b9b3-0e00-439a-8fa1-e64186505b5e--&gt;
  </code></pre>
  
  <p>Running it for IDE gives no error at that point.How can I fix/debug this.</p>
  
  <p>route configuration:</p>
  
  <pre><code> app.UseMvc(routes =&gt;
              {
                  routes.MapRoute(
                      name: "default",
                      template: "{controller=Home}/{action=Index}/{id?}");
  
                  routes.MapSpaFallbackRoute(
                      name: "spa-fallback",
                      defaults: new { controller = "Home", action = "Index" });
              });
  </code></pre>
  
  <p>thanks</p>