2010-09-20 49 views
0

我試圖爲以下(託管的MVC應用程序中的另一個MVC應用程序。):多ASP.net MVC2應用

  1. 我得到了一個MVC應用程序。直接在「默認網站」中運行...
  2. 我有另一個應用程序。 (ProductionService),這是另一種獨立的應用程序..

看起來這在IIS的管理器:

alt text

我的問題是,一個requets爲 「ProductionService」 不會被路由到應用程序。,而是由MVC-app處理。在「默認Web站點」

我嘗試了MVC IngoreRoute運行方法,但它並沒有改變結果。這裏是我的最後一個「的RegisterRoutes」用我所有的嘗試&錯誤;)

 routes.IgnoreRoute("Staging/{*pathInfo}"); 
     routes.IgnoreRoute("ProductionService/{*pathInfo}"); 
     routes.IgnoreRoute("StagingService/{*pathInfo}"); 
     routes.IgnoreRoute("/Staging/{*pathInfo}"); 
     routes.IgnoreRoute("/ProductionService/{*pathInfo}"); 
     routes.IgnoreRoute("/StagingService/{*pathInfo}"); 
     routes.IgnoreRoute("~/Staging/{*pathInfo}"); 
     routes.IgnoreRoute("~/ProductionService/{*pathInfo}"); 
     routes.IgnoreRoute("~/StagingService/{*pathInfo}"); 
     routes.IgnoreRoute("~/Staging/{*pathInfo}"); 
     routes.IgnoreRoute("~/ProductionService/{*pathInfo}"); 
     routes.IgnoreRoute("{*Staging*}"); 
     routes.IgnoreRoute("{*ProductionService*}"); 
     routes.IgnoreRoute("{*StagingService*}"); 

那麼,我有什麼想法可以做?也許配置某事。在IIS中直接?

+0

其餘路線在哪裏?像默認註冊的那個(不會被忽略) – 2010-09-20 16:12:20

+0

在帖子中刪除了......剩下的就是默認的路由,這是在visual studio中創建項目期間設置的......但無論如何這並不重要,因爲頂級應用程序工作正常(除了路由到sub.application) – David 2010-09-20 16:34:04

回答

0

我發現它... web.config中以某種方式繼承到sub.applications,所以如果我在子應用程序做一個結構類似這樣的,我的情況下,它解決了:

<!-- This is required if you want to run with sub-applications in IIS as it inherits the web.config somehow...--> 
<membership> 
    <providers> 
    <clear/> 
    </providers> 
</membership> 
<roleManager enabled="false"> 
    <providers> 
    <clear/> 
    </providers> 
</roleManager> 
<pages> 
    <namespaces> 
    <clear/> 
    </namespaces> 
</pages>