我有3台服务器,所有这些都运行Windows Web Server,.NET 4和IIS7。我的web.config文件的开头部分是:
<?xml version="1.0"?> <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> <configSections> <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings,Microsoft.Practices.EnterpriseLibrary.Logging,Version=4.1.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35" /> <section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection,Microsoft.Practices.Unity.Configuration,Version=2.0.414.0,PublicKeyToken=31bf3856ad364e35" /> <section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings,Microsoft.Practices.EnterpriseLibrary.Caching,PublicKeyToken=31bf3856ad364e35" /> <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup,System.Web.Extensions,Version=3.5.0.0,PublicKeyToken=31BF3856AD364E35"> <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup,PublicKeyToken=31BF3856AD364E35"> <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection,PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup,PublicKeyToken=31BF3856AD364E35"> <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection,PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" /> <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection,PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection,PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection,PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> </sectionGroup> </sectionGroup> </sectionGroup> </configSections>@H_404_4@这在2台服务器上工作正常,但其中一个报告错误:
@H_404_4@There is a duplicate ‘system.web.extensions/scripting/scriptResourceHandler’ section defined@H_404_4@反对:
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection,PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />@H_404_4@如果我删除单行,那么它会抱怨下一行的副本,等等,直到我删除几乎所有的配置部分。 @H_404_4@有什么想法会导致什么? @H_404_4@编辑: @H_404_4@这是一个更新为VS 2010和.NET 4的.NET 3.5应用程序。所有3台服务器都安装了.NET 2 / 3.5和4。 IIS应用程序池已经更新到.NET 4。 @H_404_4@在所有3台服务器中,machine.config文件中已经定义了一些这样的web.config部分(就像Damien的回答提到的那样),但是在3个抱怨中只有一个被重复。