iis 创建配置节时出错-找到重复的“< identityConfiguation>”配置元素

mfuanj7w  于 2022-12-04  发布在  其他
关注(0)|答案(2)|浏览(100)

我在尝试导航到我们创建并安装的服务时遇到以下错误:

  • 为system.identityModel创建配置节处理程序时出错:ID7029:在“system.identityModel”配置节中找到名称为“”的重复“identityConfiguation”配置元素。*
Line 74:     <validation validateIntegratedModeConfiguration="false" />
Line 75:   </system.webServer>
**Line 76:   <system.identityModel>**
Line 77:     <identityConfiguration name="">
Line 78:       <claimsAuthenticationManager type="Sage.IdentityModel.Claims.Sage200.WCFServiceClaimsAuthenticationManager, Sage.IdentityModel.Claims.Sage200" />

下面是正在使用的web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=***"/>
    <section name="system.identityModel.services" type="System.IdentityModel.Services.Configuration.SystemIdentityModelServicesSection, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=***"/>
    <section name="sage.identityModel.tokens.sageID" type="Sage.IdentityModel.Tokens.SageID.Configuration.ModuleConfigurationSection, Sage.IdentityModel.Tokens.SageID"/>
  </configSections>

  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />

    <add key="credentialsFile" value="c:\sage\logon\credentials.xml" />
    <add key="Sage200SiteLogonPath" value="c:\Sage\Logon" />
    <add key="ServerRootPath" value="C:\Sage" />
    <add key="SystemAdministration" value="Local" />
    <add key="Sage200Path" value="C:\inetpub\Sage 200 App Services\Sage200Services\Bin\" />
  </appSettings>

  <system.web>
    <compilation targetFramework="4.0" />
    <trust level="Full" />
  </system.web>

  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="DefaultAuthorizationBehavior">
          <serviceThrottling
                        maxConcurrentCalls="16"
                        maxConcurrentSessions="20"
                        maxConcurrentInstances="16" />
          <serviceMetadata httpGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceAuthorization principalPermissionMode ="Always" />
          <serviceCredentials useIdentityConfiguration="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>

    <protocolMapping>
      <add binding="basicHttpsBinding" scheme="https"/>
    </protocolMapping>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>

    <bindings>
      <basicHttpBinding>
        <binding name="SecureHttpBinding"
                 maxBufferPoolSize="104857600"
                 maxReceivedMessageSize="104857600"
                 maxBufferSize="104857600"
                 transferMode="Buffered">
          <security mode="Transport">
            <transport clientCredentialType ="Windows" />
          </security>
          <readerQuotas maxDepth="32"
                        maxStringContentLength="104857600"
                        maxArrayLength="104857600"
                        maxBytesPerRead="4096"
                        maxNameTableCharCount="16384"/>
        </binding>
      </basicHttpBinding>
    </bindings>

    <services>
      <service name="SageWebService.Service1"
               behaviorConfiguration="DefaultAuthorizationBehavior">
        <endpoint address="https://SERVERNAME:PORT/SageWebService/Service1.svc"
                  binding="basicHttpBinding"
                  bindingConfiguration="SecureHttpBinding"
                  contract="SageWebService.IService1"
                  listenUri="/" />
      </service>
    </services>
  </system.serviceModel>

  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="ApplicationInsightsWebTracking"/>
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"
           preCondition="managedHandler"/>
    </modules>
    <directoryBrowse enabled="true"/>
    <validation validateIntegratedModeConfiguration="false"/>
  </system.webServer>

  <system.identityModel>
    <identityConfiguration>
      <claimsAuthenticationManager type="Sage.IdentityModel.Claims.Sage200.WCFServiceClaimsAuthenticationManager, Sage.IdentityModel.Claims.Sage200"/>
      <claimsAuthorizationManager type="Sage.IdentityModel.Claims.Sage200.WCFServiceThirdPartyClaimsAuthorizationManager, Sage.IdentityModel.Claims.Sage200"/>
    </identityConfiguration>
  </system.identityModel>

  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
        <listeners>
          <add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="C:\log\Traces.svclog" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>
</configuration>

我在此配置文件或服务器上的machine.config文件中找不到定义标识配置节的其他位置。我已尝试为标识配置节指定唯一的名称,但问题仍然发生。
应用程序集区使用.net v4.0,而服务的目的是v4.5.2
我应该在什么地方查找此错误,或者此错误是否意味着其他错误?
谢谢你,

wdebmtf2

wdebmtf21#

对于将来可能会看到这个问题的任何人,我已经通过将身份模型部分更新为:

<system.identityModel>
    <remove name="SageIdentity"/>
    <identityConfiguration name="SageIdentity">
      <claimsAuthenticationManager type="Sage.IdentityModel.Claims.Sage200.WCFServiceClaimsAuthenticationManager, Sage.IdentityModel.Claims.Sage200" />
      <claimsAuthorizationManager type="Sage.IdentityModel.Claims.Sage200.WCFServiceThirdPartyClaimsAuthorizationManager, Sage.IdentityModel.Claims.Sage200" />
    </identityConfiguration>
  </system.identityModel>
rdlzhqv9

rdlzhqv92#

当我遇到这个问题时,它是我在IIS中默认网站下使用的另一个站点。我将页面移动到IIS中它自己的站点,它运行正常,但是我不能同时通过同一个端口路由两个站点。当一个关闭或使用不同的端口(如http(端口80)用于一个,https(端口443)用于另一个)时,它工作正常。

相关问题