title: How do I prevent Server Error page from showing in IIS for a .net application. I have debug=false
body: <p>I have debug=false but I am still getting the &quot;Server Error&quot; page.
  In my web.config I have:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;compilation debug="false" defaultLanguage="c#" targetFramework="4.5" /&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>When I look in UI in IIS at every level I see:
  <a href="https://i.stack.imgur.com/pS7mN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pS7mN.png" alt="enter image description here" /></a>
  But I still get the following error message instead of a generic 500 page:
  <a href="https://i.stack.imgur.com/mUn8f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mUn8f.png" alt="enter image description here" /></a>
  I have messed with a bunch of the settings and can't seem to get anything to work. What setting will prevent the stack trace from showing?</p>