title: .Net Core web application returns 500 - Internal server error
body: <p>My new .Net Core web application (deployed on IIS) returns 500 - Internal server error.</p>
  
  <p>I enabled stdoutLog, but the log file is not created. How can I debug it further?</p>
  
  <p>ADDED:</p>
  
  <p>Here is code from Startup.cs:</p>
  
  <pre><code>    public void ConfigureServices(IServiceCollection services)
      {
          services.Configure&lt;CookiePolicyOptions&gt;(options =&gt;
          {
              // This lambda determines whether user consent for non-essential cookies is needed for a given request.
              options.CheckConsentNeeded = context =&gt; true;
              options.MinimumSameSitePolicy = SameSiteMode.None;
          });       
  
  services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
  
  ...        
        }
  
  
      public void Configure(IApplicationBuilder app, IHostingEnvironment env)
      {
          if (env.IsDevelopment())
          {
              app.UseDeveloperExceptionPage();
          }
          else
          {
              app.UseExceptionHandler("/Home/Error");
              app.UseHsts();
          }
  
          app.UseHttpsRedirection();
          app.UseStaticFiles();
          app.UseCookiePolicy();
  
          app.UseMvc(routes =&gt;
          {
              routes.MapRoute(
                  name: "default",
                  template: "{controller=MarketingTools}/{action=Index}/{id?}");
          });
      }
  </code></pre>