2010-09-20 59 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>