我想通過visual studio在本地主機上發佈我的mvc網站,但問題是當我瀏覽到瀏覽器中的本地主機時,它給了我一個目錄列表頁面。這裏是發佈對話的屏幕截圖。有人可以請指導我的過程中,我一直在尋找了一整天,但不能讓它的工作在localhost上發佈我的MVC3網站
這裏的id global.ascx
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute("Facebook",
"XdReceiver",
new { controller = "Account", action = "XdReceiver" });
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
}
}
你試過導航到'http:// localhost/Rental'嗎? – 2012-02-25 14:41:32
@DarinDimitrov是的,它給了我一個404 – 2012-02-25 14:46:53