IIS7 上的多个 ASP.net MVC2 应用程序(在另一个 MVC 应用程序中托管一个 MVC 应用程序。)
我正在尝试以下内容:
- 我有一个 MVC 应用程序。直接在“默认网站”中运行...
- 我得到了另一个应用程序。 ( ProductionService )这是另一个独立的应用程序。
在 IIS 管理器中看起来像这样:
我的问题是,对“ProductionService”的请求不会路由到应用程序,而是由 MVC 应用程序处理。在“默认网站”下运行
我尝试了 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中吗?
What I am trying is the following:
- I got an MVC app. running DIRECTLY in "Default Web Site"...
- I got another app. ( ProductionService ) which is another standalone app..
Looks like this in IIS-Manager:
My problem is, that a requets to "ProductionService" is not routed to the app., but instead is handled by the MVC-app. running under "Default Web Site"
I tried the MVC IngoreRoute method, but it didn't change the result.. here is my last "RegisterRoutes" with all my try & errors ;)
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*}");
So, any ideas what I can do? Maybe configure sth. in IIS directly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现它...... web.config 以某种方式继承到了 sub.applications,所以如果我在子应用程序中执行这样的构造。对于我的情况,它已解决:
I found it... the web.config is somehow inherited to the sub.applications, so if i do a construct like this in the sub-app., for my case it was solved: