title: asp.net mvc 3 handleerror global filter always shows IIS status 500 page
body: <p>I have tried everything, even uninstalling asp.net mvc3, and I can't get HandleError global filter working.</p>
  
  <p>I have set up the HandleError filter in the Global.asax:</p>
  
  <pre><code> public static void RegisterGlobalFilters(GlobalFilterCollection filters)
   {
       filters.Add(new HandleErrorAttribute());
   }
  </code></pre>
  
  <p>Also I have CustomErrors enabled (it does not matter if i set defaultRedirect="Error" or not, I think that is in the docs because is needed for older versions of mvc):</p>
  
  <pre><code>&lt;customErrors mode="On" /&gt;
  </code></pre>
  
  <p>Trying to navigate through the page until the error gets raised, wether you do from localhost or using the hostname, inside the development server or IIS 7.5, it always redirects to a standard status 500 page, instead of my custom Error.cshtml view that I have created in Shared. Here is Error view code:</p>
  
  <pre><code>@model System.Web.Mvc.HandleErrorInfo
  
  @{
      ViewBag.Title = "Oooops";
  }
  
  &lt;h2&gt;Ooops Something really bad happened!&lt;/h2&gt;
  </code></pre>
  
  <p>Also I have noted that if I create a new ASP.NET MVC3 project and then select "Internet Application" template, and just enabling customErrors in that project, then the HandleError filter starts working just fine, however using the empty MVC3 template does not.</p>
  
  <hr>
  
  <p>I want to clarify, that indeed I can see the error view being processing when debugging, however the browser always display Error 500 page.</p>