title: Asp.net core : Calling web api returns 500
body: <p>I am new to asp.net core application.</p>
  
  <p>I have an asp.net core application which uses repository pattern. It have an api controller named <strong>ApplicationsAPIController</strong>.</p>
  
  <p><strong>ApplicationsAPIController</strong> has a <strong>GetApplications</strong> method which return all applications.</p>
  
  <p>I have app published to remote server. While calling GetApplications api from postman throws <strong>500 Internal Server Error</strong> with following HTML as response:</p>
  
  <pre><code>&lt;h1 class="text-danger"&gt;Error.&lt;/h1&gt;
  &lt;h2 class="text-danger"&gt;An error occurred while processing your request. &lt;/h2&gt;
  &lt;h3&gt;Development Mode&lt;/h3&gt;
  &lt;p&gt;
      Swapping to 
      &lt;strong&gt;Development&lt;/strong&gt; environment will display more detailed  information about the error that occurred.
  &lt;/p&gt;
  &lt;p&gt;
      &lt;strong&gt;Development environment should not be enabled in deployed applications&lt;/strong&gt;, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the
      &lt;strong&gt;ASPNETCORE_ENVIRONMENT&lt;/strong&gt; environment variable to
      &lt;strong&gt;Development&lt;/strong&gt;, and restarting the application.
  &lt;/p&gt;
  </code></pre>
  
  <p>Note: Above api is working perfectly in development enviroment (locally). </p>
  
  <p>As per the error, i think i have to set up a staging or production environment. But i could not find any good and step by step document to setup. I have tried it many ways but failed. </p>