我在 ASP.net 项目中有一个带有(常规)WCF 服务的 Silverlight 5 Prism 应用程序。我正在使用 IIS 7.5 在本地主机上托管它。我按照所有步骤
如何:使用 Windows 身份验证来保护 Silverlight 应用程序的服务
如何:在 ASP.NET 中为 Silverlight 应用程序托管安全服务
但我无法让 Windows 身份验证工作。每当我在 IIS 中关闭匿名身份验证时,我的应用程序都会引发The remote server returned an error: NotFound.
异常,因为它找不到 WCF 服务。
当我尝试在 Visual Studio 中更新服务引用时出现错误Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.
当我打开匿名身份验证时,服务可以工作,但我没有获得 Windows 用户凭据。我的浏览器(IE 8)设置为使用集成 Windows 身份验证并自动登录本地 Intranet。
我究竟做错了什么?
这是我的 IIS 7.5 配置。应用程序池以集成模式运行:
网络配置:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<compilation debug="true" />
<authentication mode="Windows" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>
</configuration>
ServiceReferences.ClientConfig:
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ISecurityService" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="TransportCredentialOnly" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:85/SecurityService/SecurityService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISecurityService"
contract="SecurityServiceReference.ISecurityService" name="BasicHttpBinding_ISecurityService" />
</client>
</system.serviceModel>
</configuration>