我有一个MVC应用程序实际上在其他几台服务器上,但我没有进行部署。对于这个部署,我已经将通配符添加到aspnet_isapi.dll,它已经摆脱了404错误。但页面并没有拉起来,而是一切都只是空白。我似乎无法找到任何IIS配置差异。全局asax.cs文件确实有路由定义,但正如我在工作服务器上看到的那样,该文件不只是挂在根目录或任何显而易见的事情。我可以在这里找到什么?
所有服务器都在运行IIS6,我对设置进行了比较,此时它们对我来说看起来一样。
...谢谢 布赖恩
编辑迄今为止的评论: 我查看了事件日志,没有运气,每个David Wang搜索各种IIS日志:blogs.msdn.com。
以下是Global.asax.cs文件......
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("error.axd"); // for Elmah
// For deployment to IIS6
routes.Add(new Route
(
"{controller}.mvc/{action}/{id}",
new RouteValueDictionary(new { action = "Index", id = (string)null }),
new MvcRouteHandler()
));
routes.MapRoute(
"WeeklyTimeSave",
"Time/Save",
new { controller = "Time", action = "Save" }
);
routes.MapRoute(
"WeeklyTimeAdd",
"Time/Add",
new { controller = "Time", action = "Add" }
);
routes.MapRoute(
"WeeklyTimeEdit",
"Time/Edit/{id}",
new { controller = "Time", action = "Edit", id = "" }
);
routes.MapRoute(
"FromSalesforce",
"Home/{id}",
new { controller = "Home", action = "Index", id = "" });
routes.MapRoute(
"Default2",
"{controller}/{id}",
new { controller = "Home", action = "Index", id = "" }
);
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = "" }
);
}
protected void Application_Start()
{
RegisterRoutes(RouteTable.Routes);
}
}
也许这就像asax文件不是它需要的那样愚蠢,但是如果我知道的话,那就好了。
答案 0 :(得分:2)
这是在IIS6上部署ASP.NET MVC 1.0时帮助我最多的主要指南:
http://www.hanselman.com/blog/DeployingASPNETMVCOnASPNET20.aspx
因为它有点扼杀REST架构中友好名称的全部概念,所以这是文件扩展名问题的解决方案:
HTTP:/ slashflux88DOTcom /博客/使用-ASP净MVC-上-IIS -6-而不最MVC扩展/
对于混淆的网址,很抱歉,我发现了垃圾邮件阻止程序。