我在Window Server 2003 R2 x64上部署MVC2应用程序时遇到问题。有没有人有同样的问题?我尝试过global.asx,通配符映射的不同方法,但无济于事。我认为这是Windows Server 2003 R2 x64特定问题。
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
答案 0 :(得分:1)
你家的目录上有Default.aspx吗?如果没有,请尝试使用此代码隐藏
添加一个public partial class _Default : Page
{
public void Page_Load(object sender, System.EventArgs e)
{
// Change the current path so that the Routing handler can correctly interpret
// the request, then restore the original path so that the OutputCache module
// can correctly process the response (if caching is enabled).
string originalPath = Request.Path;
HttpContext.Current.RewritePath(Request.ApplicationPath, false);
IHttpHandler httpHandler = new MvcHttpHandler();
httpHandler.ProcessRequest(HttpContext.Current);
HttpContext.Current.RewritePath(originalPath, false);
}
}