title: Route Attribute Not Working
body: <p>Trying to use a [Route] attribute in my MVC app, per this article:
  <a href="https://blogs.msdn.microsoft.com/webdev/2013/10/17/attribute-routing-in-asp-net-mvc-5/" rel="nofollow noreferrer">https://blogs.msdn.microsoft.com/webdev/2013/10/17/attribute-routing-in-asp-net-mvc-5/</a></p>
  
  <pre><code>[Route("Error/{type?}")]
      public ActionResult Error(string type)
      {
          if (type == "Duplicate")
          {
              ViewBag.ErrorDetails = "There is already a redirect using that Vanity URL and Domain.";
          }
  
          if (type == "Unknown")
          {
              ViewBag.ErrorDetails = "An unknown error has occured. Probably your fault too.";
          }
  
          return View();
      }
  </code></pre>
  
  <p>I have MapMvcAttributeRoutes in RouteConfig.cs</p>
  
  <pre><code>public class RouteConfig
  {
      public static void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
          routes.MapRoute(
              name: "Default",
              url: "{controller}/{action}/{id}",
              defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
          );
  
          routes.MapMvcAttributeRoutes();
      }
  }
  </code></pre>
  
  <p>I get a 404 when browsing to /Admin/Error/Duplicate but /Admin/Error?type=Duplicate works fine.</p>
  
  <p>In addition to <code>[Route("Error/{type}")]</code> I have tried <code>[Route("Admin/Error/{type})]</code> and <code>[Route("{type})]</code> but no luck.  I can't figure out where I'm going wrong.</p>