title: How to switch my ASP.NET MVC .NET 5.0 Web app to Development Mode while in Production (for JIT debugging)?
body: <p>I recently developed a new web application with ASP.NET MVC Core, using the (at the time) latest .NET build: 5.0. On the local IIS web server, the apps runs fine and can connect to the database. While in production, however, I only get a note that says I have to be in development mode to see more details on the error(s).</p>
  <p>Thus my question, if my launchsettings are set to a Development environment:</p>
  <pre><code>&quot;profiles&quot;: {
  &quot;IIS Express&quot;: {
    &quot;commandName&quot;: &quot;IISExpress&quot;,
    &quot;launchBrowser&quot;: true,
    &quot;environmentVariables&quot;: {
      &quot;ASPNETCORE_ENVIRONMENT&quot;: &quot;Development&quot;,
      &quot;ASPNETCORE_HOSTINGSTARTUPASSEMBLIES&quot;: &quot;Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation&quot;
    }
  }
  </code></pre>
  <p>And my web app has been published in &quot;Debug&quot; mode. What else can I do to get my (now online) web app to elaborate on the error(s) it is experiencing?</p>
  <p>This is the error message during production runtime, as soon as I attempt to access a data page:</p>
  <p>Error.
  An error occurred while processing your request.
  Request ID: 00-b6a4317779144a43ab28d33258720bbf-4eed6df4e6152246-00</p>
  <p>Development Mode
  Swapping to Development environment will display more detailed information about the error that occurred.</p>
  <p>The Development environment shouldn't be enabled for deployed applications. It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development and restarting the app.</p>
  <p>Is there another setting I can tweak to ensure the application launches into development mode? Just so that I can get more information on this phantom error?</p>
  <p>Thank you very much in advance!</p>