阻止< sectionGroup>上的Web.config继承. [英] Preventing Web.config inheritance on <sectionGroup>

查看:42
本文介绍了阻止< sectionGroup>上的Web.config继承.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一段时间以来,我一直在寻找解决方案,但是找不到任何地方...

I have been looking for a solution to this for a while but can not find one anywhere...

背景:我有两个Web应用程序;一个正在运行Umbraco CMS,这是根Web应用程序.第二个是MVC 4应用程序,并且是根应用程序(即/rootapp/quote)中的虚拟目录.

Background: I have two web applications; one is running Umbraco CMS, this is the root web app. The second is an MVC 4 application and is a Virtual Directory within the root app i.e. /rootapp/quote.

每个应用程序都有其自己的Web.config.最初,我在配置继承方面遇到问题,但我(几乎)通过使用< location> 标记放置在父应用程序配置中来解决了这个问题,如下所示:

Each app has its own Web.config. Initially I had issues with config inheritance but I resolved this (nearly) by placing using the <location> tag within the parent app config like so:

  <location path="." inheritInChildApplications="false">
    <system.web>
   ....
    </system.web>
  </location>

这可以修复错误,但是生成了一个我无法修复的错误..我理解这是因为父Web.config已经定义了Razor.

This fixed the errors but generated a fresh one which I can't fix.. I understand it's because the parent Web.config has already defined Razor.

我在子应用程序中尝试了< remove name ="system.web.webPages.razor"/> ,但没有运气,有什么想法可以阻止继承.

I have tried <remove name="system.web.webPages.razor"/> within the sub app with no luck, any ideas how to block inheritance..?

错误

Line 3:  <configuration>
Line 4:    <configSections>
Line 5:      <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
Line 6:        <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
Line 7:        <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />

推荐答案

它是野兽的本质.我的问题是您是否可以修改部署,以使报价应用程序不在您的根目录之内:

Its the Nature of the beast. My question is whether or not you could modify your deployment so that the quote app was not inside of your root:

Url 1: http://server/root/cms

Url 2: http://server/root/quote

然后将IIS配置为将对/root的所有请求重定向到/root/cms

Then configure IIS to redirect any requests to /root to /root/cms

这篇关于阻止&lt; sectionGroup&gt;上的Web.config继承.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆