Platform:
Windows 7 Enterprise SP 1
.NET Framework 4 w/ WCF Services…
IIS 7.5 (Virt dir hosting WCF service configured for Windows Authentication only. Anonymous disabled)
Silverlight V4 Client
Error:
The error I get when trying to access a WCF service configured to use Windows Authentication (either by launching the service/host web project from within visual studio, or trying to access the service via IE (http://localhost/SecurityService.svc) is:
Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NotSupportedException: Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.
The web config for the WCF Service is :
="1.0"
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Windows"/>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="false"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="AppHttpBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" />
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="Volpe.Services.SAS.Internal.Host.SecurityService">
<endpoint name="AppHttpEndpoint" address=""
binding="basicHttpBinding" bindingConfiguration="AppHttpBinding"
contract="Volpe.Services.SAS.Internal.Contracts.Security.ISecurityService" />
</service>
<service name="Volpe.Services.SAS.Internal.Host.NotificationService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="AppHttpBinding"
contract="Volpe.Services.SAS.Internal.Contracts.Notifications.INotificationService"/>
</service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
I of course Googled this error multiple times, and saw various technical articles addressing how to get rid of the error. Most attributed it to having a MEX endpoint defined. As you can see in the web.config above, there is no such endpoint defined. It seems like there’s something specific in our solution framework that is causing the WCF runtime to think that it requires Anonymous access to the site. I tried debugging it by trying a multitude of potential solutions. I even downloaded the .NET framework code and stepped through it, but I still get the error.
Any help would be greatly appreciated.
Thanks,
Tom