我们有一个简单的WCF(使用.NET 4.0)服务,它使用Windows
身份验证在IIS 7身份验证功能上启用。这适用于两台服务器上相同的设置和相同的配置,但在其中一台服务器上出现错误Security settings for this service require Windows Authentication but it is not enabled for the IIS application that hosts this service.
我检查了所有可能的网络,并尝试了所有选项,如禁用其他身份验证机制等。似乎没有任何工作。任何人都可以指出可能是什么问题。 两台服务器上的相同settigns在第三台服务器上运行正常,因此存在问题。WCF(.NET 4.0)+ IIS 7 + Windows身份验证错误 - “服务需要Windows身份验证,但未启用IIS应用程序”
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="ABCDbConnection" value="Data Source=xxx; Initial Catalog=sss;Integrated Security=True"/>
<add key="MetadataDbConnection" value="Data Source=xxx; Initial Catalog=sss;Integrated Security=True"/>
<add key="UsageEnabled" value="True"/>
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<protocolMapping>
<add scheme="http" binding="basicHttpBinding" bindingConfiguration="WindowsBasicHttpBinding"/>
</protocolMapping>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="6553600"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="WindowsBasicHttpBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
谢谢[KB文章(http://support.microsoft.com/kb/215383)禁用解决了这个问题。即使KB是针对IIS 6的,它也可以解决IIS 7上的这个问题:D – 2011-03-11 00:23:14