WCF部署至IIS问题二则

Server Application Unavailable

查日志:

Failed to initialize the AppDomain:/LM/W3SVC/1/Root/login

Exception: System.IO.FileLoadException

Message: Could not load file or assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Access is denied.

问题分析:此问题并非WCF特有。解决办法为,设置Service所在Folder的权限,使其允许Network Service用户有完全权限。

WCF exception: Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.

问题背景:客户端之一为Silverlight。所以需采用basicHttpBinding;采用集成域验证,即站点的security设置中需要禁用匿名访问。

解决方式:

1.<basicHttpBinding>
  <binding>
    <security mode="TransportCredentialOnly">
      <transport clientCredentialType="Windows" />
    </security>
  </binding>
</basicHttpBinding>

2.去除所有的

<endpointaddress="mexbinding="mexHttpBindingcontract="IMetadataExchange"/>

原文地址:https://www.cnblogs.com/damnedmoon/p/1891589.html