This is a problem for me with .NET 3.5 Service Pack 1 (SP1) running on 64-bit IIS7.5 (I tried to force 32-bit but got the same result).
I have a WCF service with which I want to use authentication services. When I have no behavior, the WCF service draws (responds) without any errors. Other services also work with other types of behavior.
As soon as I add userNameAuthentication to the behavior defining the user MemberhipProvider for authentication for the service ...
<serviceCredentials> <userNameAuthentication userNamePasswordValidationMode ="MembershipProvider" membershipProviderName ="MembershipService"/> </serviceCredentials>
The service explodes and returns the following error:
Parser Error Message: Default Membership Provider could not be found. Source Error: Line 49: </authentication> Line 50: Line 51: <membership defaultProvider="MembershipService" userIsOnlineTimeWindow="15"> Line 52: <providers> Line 53: <clear/>
The event log has this error:
WebHost failed to process a request. Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/59884855 Exception: System.ServiceModel.ServiceActivationException: The service '/V4Service.svc' cannot be activated due to an exception during compilation. The exception message is: Default Membership Provider could not be found. (C:\Code\SmartTrade Projects\SmartTrade.API\Web\SmartTrade.API\web.config line 50). ---> System.Configuration.ConfigurationErrorsException: Default Membership Provider could not be found. (C:\Code\SmartTrade Projects\SmartTrade.API\Web\SmartTrade.API\web.config line 50) at System.Web.Security.Membership.Initialize() at System.Web.Security.Membership.get_Providers() at System.ServiceModel.Configuration.UserNameServiceElement.ApplyConfiguration(UserNamePasswordServiceCredential userName) at System.ServiceModel.Configuration.ServiceCredentialsElement.ApplyConfiguration(ServiceCredentials behavior) at System.ServiceModel.Configuration.ServiceCredentialsElement.CreateBehavior() at System.ServiceModel.Description.ConfigLoader.LoadBehaviors[T](ServiceModelExtensionCollectionElement`1 behaviorElement, KeyedByTypeCollection`1 behaviors, Boolean commonBehaviors) at System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress) at System.ServiceModel.ServiceHostBase.ApplyConfiguration() at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
I am sure that this is not a problem with the configuration of the provider or provider, as I have this custom provider working with the ASP MVC site.
Any thoughts?
source share