WCF services fail with NotSupportedException or ServiceActivationException after applying updates for .NET Framework 4

Symptoms

Consider the following scenario. You have a Windows Communication Foundation (WCF) service using Microsoft .NET Framework 4.0, hosted in a Microsoft Internet Information Services (IIS) web server. Under the SSL settings for the web application, you have enabled "Require SSL" as well as requiring client certificates. You then apply one of or more of the following hotfixes for WCF on .NET Framework 4:



In this configuration, when you try to browse to or make a method call to the WCF service that is using client certificate authentication, you may receive an error message and stack trace similar to the one below. You may receive this error even if you have not changed any other setting in the WCF configuration or IIS SSL configuration:
System.NotSupportedException: The SSL settings for the service 'None' does not match those of the IIS 'Ssl, SslNegotiateCert, SslRequireCert'. 
Stack Trace:
[NotSupportedException: The SSL settings for the service 'None' does not match those of the IIS 'Ssl, SslNegotiateCert, SslRequireCert'.]
System.ServiceModel.Activation.HostedAspNetEnvironment.ValidateHttpsSettings(String virtualPath, Nullable`1& requireClientCertificate) +186762
System.ServiceModel.Channels.HttpsChannelListener.ApplyHostedContext(String virtualPath, Boolean isMetadataListener) +176
System.ServiceModel.Channels.HttpsTransportBindingElement.BuildChannelListener(BindingContext context) +123
System.ServiceModel.Channels.Binding.BuildChannelListener(Uri listenUriBaseAddress, String listenUriRelativeAddress, ListenUriMode listenUriMode, BindingParameterCollection parameters) +177
System.ServiceModel.Description.ServiceMetadataExtension.CreateGetDispatcher(Uri listenUri, Binding binding) +189
System.ServiceModel.Description.ServiceMetadataExtension.EnsureGetDispatcher(Uri listenUri, Boolean isServiceDebugBehavior) +229
System.ServiceModel.Description.ServiceMetadataBehavior.EnsureGetDispatcher(ServiceHostBase host, ServiceMetadataExtension mex, Uri url, String scheme) +195
System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost) +3565
System.ServiceModel.ServiceHostBase.InitializeRuntime() +82
System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +64
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +789
System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +255
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +1132

[ServiceActivationException: The service '/WCFService/Service1.svc' cannot be activated due to an exception during compilation. The exception message is: The SSL settings for the service 'None' does not match those of the IIS 'Ssl, SslNegotiateCert, SslRequireCert'..]
System.Runtime.AsyncResult.End(IAsyncResult result) +890624
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +181790
System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +107

Cause

This issue occurs due to a mismatch in the versions of System.ServiceModel.Activation.dll and System.ServiceModel.dll.


Resolution

To resolve this problem, install the Microsoft hotfix 2537715 after installing any of the hotfixes mentioned in the above list.


More Information

If you already have the Microsoft hotfix 2537715 installed, and then you install one of the hotfixes mentioned above in the Symptoms section, then the Activation Exception issue described in this article does not occur.


Properties

Article ID: 2740200 - Last Review: Sep 7, 2012 - Revision: 1

Feedback