ASP.NET - 使用WCF Web服务绑定w/AD组的IIS7部署错误500 24 50

Bri*_*thy 4 asp.net wcf wcf-binding wcf-security iis-7.5

背景:在部署在本地计算机上无错误编译的应用程序后,我收到内部服务器500 24 50错误.部署应用程序的服务器具有大量安全性并且运行IIS 7.5,因此我需要为每个目录指定读写访问权限.此应用程序使用Windows身份验证和Web服务通过代理填充下拉框.我认为连接到Web服务可能存在问题,或者文件的读/写安全性问题,或者活动目录身份验证存在问题.

由于某种原因,Internet Explorer刚刚显示无法加载网页错误.

Google Chrome中出错:

 500 – Internal Server Error.
 There is a problem with the resource you are looking for, and it cannot be displayed. 
Run Code Online (Sandbox Code Playgroud)

日志文件详情:

 #Software: Microsoft Internet Information Services 7.5
 #Fields: date time s-sitename s-computername s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs-version cs(User-Agent) cs(Cookie) cs(Referer) cs-host sc-status sc-substatus sc-win32-status sc-bytes cs-bytes time-taken

 2011-05-18 13:54:46 W3SVC1 FL-TPA-WEB-01 172.17.1.25 GET / - 80 - 
 172.17.1.25 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.1;+WOW64;
 +Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET4.0C;+.NET4.0E) - -
 invitations.myagencyservices.com 500 24 50 1380 368 15
Run Code Online (Sandbox Code Playgroud)

MSDN将错误定义为http://support.microsoft.com/kb/943891,如下所示:

  500.24 - An ASP.NET impersonation configuration does not apply in Managed 
           Pipeline mode.
Run Code Online (Sandbox Code Playgroud)

Web.Config代码:

  <system.web>
  <customErrors mode="Off" ></customErrors>
  <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
  <trace enabled="true" pageOutput="true" />


  <authentication mode="Windows"/> 
  <identity impersonate="true"/>  

    <authorization>          
    <allow users="alg\bmccarthy, alg\phoward" />               
    <allow roles="alg\ACOMP_USER_ADMIN" />
    <allow roles="alg\ACOMP_user_AMG" />
    <allow roles="alg\ACOMP_user_BIG" />
    <allow roles="alg\ACOMP_user_NIS" />
    <allow roles="alg\ACOMP_user_GLA" />
    <allow roles="alg\ACOMP_user_PIP" />
    <allow roles="alg\ACOMP_user_PSM" />
    <allow roles="alg\ACOMP_user_PAM" />
    <allow roles="alg\ACOMP_user_ANN" />
    <allow roles="alg\ACOMP_user_AAM" />
    <allow roles="alg\ACOMP_user_MWM" /> 
    <allow roles="alg\ACOMP_user_GIM" />
    <deny users="*" />      
  </authorization> 
  </system.web>

  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

  <system.serviceModel>
    <bindings>
    <basicHttpBinding>
    <binding name="BasicHttpBinding_IAcompService1" closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
      allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
      maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
      messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
      useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <security mode="None">
        <transport clientCredentialType="None" proxyCredentialType="None"
          realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
        </security>
      </binding>
   </basicHttpBinding>
  </bindings>

    <client>
        <endpoint address="http://63.236.108.91/aCompService.svc" binding="basicHttpBinding"
    bindingConfiguration="BasicHttpBinding_IAcompService1" contract="aComp_ServiceReference.IAcompService"
    name="BasicHttpBinding_IAcompService1" />
    </client>
  </system.serviceModel>
Run Code Online (Sandbox Code Playgroud)

任何建议都将被投票!谢谢你的期待!

Bri*_*thy 13

发生500.24.50错误是因为ASP.NET集成模式无法模拟BeginRequest和AuthenticateRequest管道阶段中的请求标识.如果您的应用程序在集成模式下运行,则声明500.24,未声明validateIntegratedModeConfiguration或设置为true,并且您的应用程序将标识模拟设置为true.

解决方法

答:如果您的应用程序不依赖于在BeginRequest和AuthenticateRequest阶段模拟请求用户(在集成模式下无法模拟的唯一阶段),请通过将以下内容添加到应用程序的web.config来忽略此错误:

  <system.webServer>
          <validation validateIntegratedModeConfiguration="false" />
  </system.webServer>
Run Code Online (Sandbox Code Playgroud)

B.如果您的应用程序确实依赖于BeginRequest和AuthenticateRequest中的模拟,或者您不确定,请转到经典模式.

C.从web.config中删除无论如何都无法在集成模式下生效

阅读LEARN.IIS.NET中有关IIS 7中的重大更改的更多信息