title: MVC3, ASP.NET 4 - The resource cannot be found.
body: <p>I have VS2010, MVC3 and ASP.NET 4.0 with a simple test mvc application. The problem is that I am still keep getting error:</p>
  
  <h2>Server Error in '/' Application.</h2>
  
  <p>The resource cannot be found. 
  Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. </p>
  
  <p>Requested URL: /Pizzas/Pizza</p>
  
  <p>Here is my simple controller :</p>
  
  <pre><code>public class PizzasController : Controller
  {
  public ActionResult Pizza()
  {
  var pizzas = new Pizza();
  return View("Pizza", pizza);
  }
  
  }
  </code></pre>
  
  <p>Here is a part of my global.asax:</p>
  
  <pre><code>    public static void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
          routes.IgnoreRoute("{Scripts}/{*pathInfo}");
  
          routes.MapRoute(
            "Pizza_1",
            "Pizzas/Pizza",
            new { controller = "Pizzas", action = "Pizza"}
  
        );
  
          routes.MapRoute(
              "Pizzas_2", // Route name
              "{controller}/{action}", // URL with parameters
              new { controller = "Pizzas", action = "Pizza" } // Parameter defaults
          );
  
          }
  </code></pre>
  
  <p>I am trying to call this action from a pizza.cshtml by this way:</p>
  
  <pre><code>@Html.ActionLink("Test", "Pizza", "Pizzas");
  </code></pre>
  
  <p>When the both routes are uncomented, then execution goes to Pizza_2 route and it passes without problems.  But if I commented out Pizza_2, then it goes to Pizza_1 and the error occurs without getting to the action method.
  The application runs on ASP.NET development server (not  IIS). 
  I noticed that it works with Pizza_2 route only when there is no full url specified:
  <a href="http://localhost:2893" rel="nofollow">http://localhost:2893</a></p>
  
  <p>but if type the full url like this:
  <a href="http://localhost:2893/Pizzas/Pizza" rel="nofollow">http://localhost:2893/Pizzas/Pizza</a></p>
  
  <p>the error again occurs.</p>