2013-07-16 60 views
0

我有一個ASP.NET MVC應用程序的問題,這本地一切正確,包括天藍色的模擬器,但在發佈到天藍色後,路由停止工作,我正在此錯誤ASP.NET MVC 4應用程序路由不工作在azure

在路由表中的路由提供的值相匹配

這裏是我的路由到RouteConfig

routes.MapRoute(
     "Default", // Route name 
     "{controller}/{action}/", // URL with parameters 
     new { controller = "Home", action = "Index"} // Parameter defaults 
     ); 

     routes.MapRoute(
     "Default2", // Route name 
     "{controller}/{action}/{urltoken}/{id}", // URL with parameters 
     new { controller = "Home", action = "Index", urltoken = UrlParameter.Optional, id = UrlParameter.Optional } // Parameter defaults 
     ); 

每當我嘗試登錄時發生這種情況,表單提交後出現錯誤..

有人知道爲什麼路由不工作到天藍色?

這是錯誤的圖像:

鏈接圖像>1

更新:

我正在讀一些帖子談論

<modules runAllManagedModulesForAllRequests="true" /> 

和意志測試這個..

 <modules> 
    <remove name="SessionAuthenticationModule" /> 
    <add name="SessionAuthenticationModule" type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 
    <remove name="UrlRoutingModule-4.0" /> 
    <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" /> 
</modules> 
+0

在第一路刪除尾隨斜線'{控制器}/{行動} /'並將其移動到最後註冊的路線。 – haim770

回答

1

有幾個檢查,你可以執行:

  • 確保本地MVC庫的副本設置爲true。以下是MVC查找庫:

    System.Web.Abstractions.dll

    System.Web.WebPages.Razor.dll

    System.Web.WebPages.dll

    系統。 Web.WebPages.Deployment.dll

    System.Web.Razor.dll

    System.Web.Helpers.dll

    System.Web.Mvc.dll

    實際上,我建議你從解決方案中的文件夾中引用這些程序集。

  • 其次,你還可以檢查在web.config中System.webServer以下設置:

    <modules runAllManagedModulesForAllRequests="true" /> 
    
+0

你能解釋一下runAllManagedModulesForAllRequests嗎? –