English 中文(简体)
编组部分外部汇辑
原标题:External config file for part of configuration section

I m trying to use an external configuration file to define multiple location elements within the the root <configuration> section of my web.config file. Is this possible?

I understand how to do this for a single section (e.g. connectionStrings) but can this be done for multiple elements within the configuration element? <configuration>; itself doesn t allow the configSource attribute. Is it possible to create a dummy element and define it in configSections, if so what type do I give it?

背景资料: 我希望这样做,以便我能够确定永久的方向,其中可能有数百人最理想的是,我不想在网上界定这一点。 conf。 i.e.

<configuration>
  <!-- rest of web.config here -->
  <!-- i need mutiple location elements so want these in an external file-->
  <location path="oldpage">
    <system.webServer>
      <httpRedirect enabled="true" destination="/uk/business" httpResponseStatus="Permanent" />
    </system.webServer>
  </location>
</configuration>
最佳回答
问题回答

你们要求你做些什么,只是需要:

<rewrite>
  <rules configSource="rewrites.config" />
</rewrite>

任何档案名称都应足够。

您将制定<代码>configSource。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签