作为我们安装新版本的一部分,我们有 web.config.delta 文件,可以根据需要调整现有的 web.config 文件。现在我知道如何添加/更新/删除 AppSetting 键(因为我在此找到的所有帖子都是关于此的)但我不知道如何添加新的部分元素,添加新的部分组。
IE。这是我的 web.config 中的所有新内容。我需要更改哪些内容才能将其应用为“增量”?
<?xml version="1.0"?>
<configuration xmlns:xmu="urn:msbuildcommunitytasks-xmlmassupdate">
<configSections>
<section xmu:key="name" name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
<section xmu:key="name" name="securityConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Security.Configuration.SecuritySettings, Microsoft.Practices.EnterpriseLibrary.Security, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
<sectionGroup name="authorization" type="Company.Security.Configuration.AuthorizationSectionGroup, Company.Library">
<section name="rowLevelSecurity" type="Company.Security.Configuration.RowLevelAuthorizationSection, Company.Library"/>
<section name="typeBasedSecurity" type="Company.Security.Configuration.TypeAuthorizationSection, Company.Library"/>
</sectionGroup>
</configSections>
<enterpriseLibrary.ConfigurationSource selectedSource="System Configuration Source">
<sources>
<add name="System Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.SystemConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="Security-FileBasedConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
filePath="Config/Enterprise-Security.config" />
</sources>
<redirectSections>
<add sourceName="Security-FileBasedConfigurationSource" name="securityConfiguration" />
</redirectSections>
</enterpriseLibrary.ConfigurationSource>
<authorization>
<rowLevelSecurity defaultProvider="SqlMembershipRowLevelSecurity">
<providers>
<add name="SqlMembershipRowLevelSecurity" type="Company.Security.DataAuthorization.SqlMembershipRowLevelSecurityProvider, Company.Library" applicationName="app1" connectionStringName="SecurityConnection"/>
</providers>
</rowLevelSecurity>
<typeBasedSecurity defaultProvider="SqlInPlaceTypeBasedSecurity">
<providers>
<add name="SqlInPlaceTypeBasedSecurity" type="Company.Security.Providers.SqlEntityTypeFunctionTypeSecurityProvider, Company.Common" applicationName="app1" connectionStringName="SecurityConnection"/>
</providers>
</typeBasedSecurity>
</authorization>
</configuration>
我似乎找不到关于这些东西的任何简单信息——但也许我在谷歌上搜索错误的术语。
我是否只需要替换添加位,例如:
<add name="System Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.SystemConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add xmu:key="name" name="System Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.SystemConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" xmu:action="add" />
还是我必须对 section、sectiongroup 和 enterpriseLibrary.ConfigurationSource 元素做同样的事情?
谢谢!