2010-12-03 102 views
0

我在Window Server 2003 R2 x64上部署MVC2應用程序時出現問題。有沒有人有同樣的問題?我已經嘗試了不同的方法,從global.asx,通配符映射和無濟於事。我在想這是Windows Server 2003 R2 x64特定問題。在Window Server 2003 R2 x64上部署MVC2應用程序iis6

http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx

Deploying Asp.Net MVC 2 /C# 4.0 application on IIS 6

+0

您在應用程序中遇到了什麼問題?沒有編譯?沒有正確的路由?其他? – Jaime 2010-12-03 18:52:31

+0

編譯沒問題,在服務器上部署了發佈bin並獲得了HTTP 401.1 - 未經授權:登錄失敗錯誤 – odez213 2010-12-03 18:56:47

回答

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); 
    } 
} 
相關問題