title: ASP.NET Core: Not seeing detailed errors, even though environment variable is set to development
body: <p>I set my environment variables for each web site to <code>development</code> mode, but I am still not getting detailed error messages. Instead, I am getting a message that:</p>
  <blockquote>
  <p>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.&quot;</p>
  </blockquote>
  <h3>launchsettings.json:</h3>
  <pre><code>{
    &quot;iisSettings&quot;: {
      &quot;windowsAuthentication&quot;: false,
      &quot;anonymousAuthentication&quot;: true,
      &quot;iisExpress&quot;: {
        &quot;applicationUrl&quot;: &quot;http://localhost:50802&quot;,
        &quot;sslPort&quot;: 44399
      }
    },
    &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;FazalElectronics&quot;: {
        &quot;commandName&quot;: &quot;Project&quot;,
        &quot;launchBrowser&quot;: true,
        &quot;environmentVariables&quot;: {
          &quot;ASPNETCORE_ENVIRONMENT&quot;: &quot;Development&quot;
        },
        &quot;applicationUrl&quot;: &quot;https://localhost:5001;http://localhost:5000&quot;
      }
    }
  }
  </code></pre>
  <h3>Startup.cs</h3>
  <pre class="lang-cs prettyprint-override"><code>public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
  {
    if (env.IsDevelopment())
    {
      app.UseDeveloperExceptionPage();
      app.UseDatabaseErrorPage();
    }
    else
    {
      app.UseExceptionHandler(&quot;/Home/Error&quot;);
      // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
      app.UseHsts();
    }
    app.UseHttpsRedirection();
    app.UseStaticFiles();
  
    app.UseRouting();
  
    app.UseAuthentication();
    app.UseAuthorization();
  
    app.UseEndpoints(endpoints =&gt;
    {
      endpoints.MapControllerRoute(
        name: &quot;default&quot;,
        pattern: &quot;{controller=Home}/{action=Index}/{id?}&quot;);
        endpoints.MapRazorPages();
    });
  }
  </code></pre>
  <p><strong>Error Message:</strong>
  <a href="https://i.stack.imgur.com/sxSZB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sxSZB.png" alt="Screenshot of error message" /></a></p>
  <p>One thing is especially confusing to me: When I publish my app to the server, I get an additional <code>appsetting.production.json</code> file, but I don't have any idea what it does.</p>