title: The view 'Error' or its master was not found
body: <p>I've spent a lot of time trying to figure out a workaround for this to no avail, so I thought I'd see if anyone here has an idea.</p>
  
  <p>I'm using <a href="https://stackoverflow.com/questions/766610/how-to-get-elmah-to-work-with-asp-net-mvc-handleerror-attribute">Elmah in my ASP.NET MVC3 application</a>.  I'm using the exact same code from the accepted answer in the previous link.</p>
  
  <p>I also have this code in my Global.asax for displaying error pages with the correct HTTP response:</p>
  
  <pre><code>    /// &lt;summary&gt;
      /// The customErrors functionality provided by ASP.NET results in HTTP 302 redirects occurring which doesn't accurately reflect what the real HTTP code of the response was.
      /// This method can be used to handle specific HTTP codes without an intermediate redirect.
      /// &lt;/summary&gt;
      protected void Application_Error() {
          var exception = Server.GetLastError();
          var httpException = exception as HttpException;
          Response.Clear();
          Server.ClearError();
          var routeData = new RouteData();
          routeData.Values["controller"] = "Error";
          routeData.Values["action"] = "Error500";
          Response.StatusCode = 500;
  
          if (httpException != null) {
              Response.StatusCode = httpException.GetHttpCode();
              Response.TrySkipIisCustomErrors = true;
              switch (Response.StatusCode) {
                  case 403:
                      routeData.Values["action"] = "Error403";
                      break;
                  case 404:
                      routeData.Values["action"] = "Error404";
                      routeData.Values["message"] = httpException.Message;
                      break;
                  case 500:
                      routeData.Values["action"] = "Error500";
                      break;
              }
          }
  
          IController errorsController = new ErrorController();
          var rc = new RequestContext(new HttpContextWrapper(Context), routeData);
          errorsController.Execute(rc);
      }
  </code></pre>
  
  <p>The problem occurs when I'm not on my (local) development machine (which initially made me think it was <a href="http://msdn.microsoft.com/en-us/library/h0hfz6fc.aspx" rel="noreferrer">customErrors</a> related).  When an exception is thrown, Elmah handles the error and logs it correctly.  I also end up on the correct error page.  However, before ending up on the correct error page, I can see another intermediate exception being logged:</p>
  
  <pre><code>The view 'Error' or its master was not found or no view engine supports the searched locations. The following locations were searched: ~/Views/Articles/Error.aspx ~/Views/Articles/Error.ascx ~/Views/Shared/Error.aspx ~/Views/Shared/Error.ascx ~/Views/Articles/Error.cshtml ~/Views/Articles/Error.vbhtml ~/Views/Shared/Error.cshtml ~/Views/Shared/Error.vbhtml
  </code></pre>
  
  <p>ASP.NET is trying to load up a default error page even though I am trying to handle it.  Does anyone have any ideas on how to prevent this?</p>