FIX: Assembly binding redirection does not work for a WCF behavior extension in a .NET Framework 3.5-based or .NET Framework 4-based WCF service

Applies to: Microsoft .NET Framework 3.5 Service Pack 1

Symptoms


Consider the following scenario:
  • You have a Microsoft .NET Framework 3.5-based Windows Communication Foundation (WCF) service or a Microsoft .NET Framework 4-based WCF service.
  • You implement a custom behavior extension for the WCF service.
  • You open the App.config file or the Web.config file of the WCF service, and then you use the following code to redirect the assembly for the WCF behavior extension to the new version:

    <configuration>
    <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
    <assemblyIdentity name="BehaviorExtensionAssemblyName" publicKeyToken="BehaviorExtensionAssemblyToken" culture="neutral"/>
    <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/>
    </dependentAssembly>
    </assemblyBinding>
    </runtime>
    </configuration>
  • You insert the following code between the "configuration" tags in order to configure the WCF extension behavior:

    <system.serviceModel> 
    <extensions>
    <behaviorExtensions>
    <add name="BehaviorExtensionName" type="BehaviorExtensionType, BehaviorExtensionAssemblyName, Version=1.0.0.0,
    Culture=neutral, PublicKeyToken= BehaviorExtensionAssemblyToken"/>
    </behaviorExtensions>
    </extensions>

    <behaviors>
    <serviceBehaviors>
    <behavior name="Default">
    <BehaviorExtensionName/>
    </behavior>
    </serviceBehaviors>
    </behaviors>
    </system.serviceModel>
  • You save the file, and then you run the WCF service.
In this scenario, the WCF behavior extension is not redirected to the new version of the assembly. Additionally, you receive the following error message:

An error occurred creating the configuration section handler for system.serviceModel/behaviors: Extension element '<BehaviorExtensionName>' cannot be added to this element. Verify that the extension is registered in the extension collection at system.serviceModel/extensions/behaviorExtensions.


Notes
  • BehaviorExtensionAssemblyName is a placeholder that represents the name of the behavior extension assembly.
  • BehaviorExtensionAssemblyToken is a placeholder that represents the token of the behavior extension assembly.
  • BehaviorExtensionName is a placeholder that represents the name of the behavior extension.
  • BehaviorExtensionType is a placeholder that represents the type of the behavior extension.

Cause


This issue occurs because of a problem in the code that loads the extension. This problem prevents the version information from being redirected.

Resolution


Hotfix information

A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that this article describes. Apply it only to systems that are experiencing this specific problem.

To resolve this problem, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft website:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

Prerequisites

To apply this hotfix, you must install one of the following products:
  • The Microsoft .NET Framework 3.5 Service Pack 1 (SP1)
  • The Microsoft .NET Framework 3.0 Service Pack 2 (SP2)
  • The Microsoft .NET Framework 4
Note The .NET Framework 3.5 SP1 contains the .NET Framework 3.0 SP2.

Restart requirement

You do not have to restart the computer after you install the hotfix if the related .NET Framework instance is not being used.

File information

The global version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

or the .NET Framework 3.0 SP2 or .NET Framework 3.5 SP1

For all supported x86-based versions of Windows 7
File nameFile versionFile sizeDateTimePlatform
Smdiagnostics.dll3.0.4506.5804110,59202-Apr-201222:31x86
Smsvchost.exe3.0.4506.5804129,60802-Apr-201222:31x86
System.identitymodel.dll3.0.4506.5804442,36802-Apr-201222:31x86
System.runtime.serialization.dll3.0.4506.5804970,75202-Apr-201222:31x86
System.runtime.serialization.dll3.0.4506.5804970,75202-Apr-201222:31x86
System.servicemodel.dll3.0.4506.58045,992,44802-Apr-201222:31x86
System.servicemodel.washosting.dll3.0.4506.580432,76802-Apr-201222:31x86
System.servicemodel.dll3.0.4506.58045,992,44802-Apr-201222:31x86
Servicemonikersupport.dll3.0.4506.580418,01602-Apr-201222:31x86
System.identitymodel.dll3.0.4506.5804442,36802-Apr-201222:31x86
System.runtime.serialization.dll3.0.4506.5804970,75202-Apr-201222:31x86
System.servicemodel.dll3.0.4506.58045,992,44802-Apr-201222:31x86
For all supported x86-based versions of Windows Server 2003 and Windows XP
File nameFile versionFile sizeDateTimePlatform
Servicemonikersupport.dll3.0.4506.580218,01629-Mar-201201:44x86
Smdiagnostics.dll3.0.4506.5802110,59229-Mar-201201:44x86
Smsvchost.exe3.0.4506.5802129,60829-Mar-201201:44x86
System.identitymodel.dll3.0.4506.5802442,36829-Mar-201201:44x86
System.runtime.serialization.dll3.0.4506.5802970,75229-Mar-201201:44x86
System.servicemodel.dll3.0.4506.58025,992,44829-Mar-201201:44x86
System.servicemodel.washosting.dll3.0.4506.580232,76829-Mar-201201:44x86
For all supported x64-based versions of Windows 7 and Windows Server 2008 R2
File nameFile versionFile sizeDateTimePlatform
Servicemonikersupport.dll3.0.4506.580420,06402-Apr-201222:30x64
Smdiagnostics.dll3.0.4506.580494,20802-Apr-201222:30x86
Smsvchost.exe3.0.4506.5804117,32002-Apr-201222:30x86
System.identitymodel.dll3.0.4506.5804401,40802-Apr-201222:30x86
System.runtime.serialization.dll3.0.4506.5804847,87202-Apr-201222:30x86
System.runtime.serialization.dll3.0.4506.5804847,87202-Apr-201222:30x86
System.servicemodel.dll3.0.4506.58045,332,99202-Apr-201222:30x86
System.servicemodel.washosting.dll3.0.4506.580432,76802-Apr-201222:30x86
System.servicemodel.dll3.0.4506.58045,332,99202-Apr-201222:30x86
Smdiagnostics.dll3.0.4506.5804110,59202-Apr-201222:31x86
Smsvchost.exe3.0.4506.5804129,60802-Apr-201222:31x86
System.identitymodel.dll3.0.4506.5804442,36802-Apr-201222:31x86
System.runtime.serialization.dll3.0.4506.5804970,75202-Apr-201222:31x86
System.runtime.serialization.dll3.0.4506.5804970,75202-Apr-201222:31x86
System.servicemodel.dll3.0.4506.58045,992,44802-Apr-201222:31x86
System.servicemodel.washosting.dll3.0.4506.580432,76802-Apr-201222:31x86
System.servicemodel.dll3.0.4506.58045,992,44802-Apr-201222:31x86
Servicemonikersupport.dll3.0.4506.580418,01602-Apr-201222:31x86
System.identitymodel.dll3.0.4506.5804442,36802-Apr-201222:31x86
System.runtime.serialization.dll3.0.4506.5804970,75202-Apr-201222:31x86
System.servicemodel.dll3.0.4506.58045,992,44802-Apr-201222:31x86
For all supported x64-based versions of Windows Server 2003 and Windows XP
File nameFile versionFile sizeDateTimePlatform
Servicemonikersupport.dll3.0.4506.580220,06429-Mar-201201:08x64
Servicemonikersupport.dll3.0.4506.580218,01629-Mar-201201:44x86
Smdiagnostics.dll3.0.4506.580294,20829-Mar-201201:08x86
Smdiagnostics.dll3.0.4506.5802110,59229-Mar-201201:44x86
Smsvchost.exe3.0.4506.5802117,32029-Mar-201201:08x86
Smsvchost.exe3.0.4506.5802129,60829-Mar-201201:44x86
System.identitymodel.dll3.0.4506.5802401,40829-Mar-201201:08x86
System.identitymodel.dll3.0.4506.5802442,36829-Mar-201201:44x86
System.runtime.serialization.dll3.0.4506.5802847,87229-Mar-201201:08x86
System.runtime.serialization.dll3.0.4506.5802970,75229-Mar-201201:44x86
System.servicemodel.dll3.0.4506.58025,332,99229-Mar-201201:08x86
System.servicemodel.dll3.0.4506.58025,992,44829-Mar-201201:44x86
System.servicemodel.washosting.dll3.0.4506.580232,76829-Mar-201201:08x86
System.servicemodel.washosting.dll3.0.4506.580232,76829-Mar-201201:44x86
For all supported Itanium-based versions of Windows 7 and Windows Server 2008 R2
File nameFile versionFile sizeDateTimePlatform
Servicemonikersupport.dll3.0.4506.580434,40002-Apr-201222:23IA-64
Smdiagnostics.dll3.0.4506.580494,20802-Apr-201222:23x86
Smsvchost.exe3.0.4506.5804117,32002-Apr-201222:23x86
System.identitymodel.dll3.0.4506.5804401,40802-Apr-201222:23x86
System.runtime.serialization.dll3.0.4506.5804847,87202-Apr-201222:23x86
System.runtime.serialization.dll3.0.4506.5804847,87202-Apr-201222:23x86
System.servicemodel.dll3.0.4506.58045,332,99202-Apr-201222:23x86
System.servicemodel.washosting.dll3.0.4506.580432,76802-Apr-201222:23x86
System.servicemodel.dll3.0.4506.58045,332,99202-Apr-201222:23x86
Smdiagnostics.dll3.0.4506.5804110,59202-Apr-201222:31x86
Smsvchost.exe3.0.4506.5804129,60802-Apr-201222:31x86
System.identitymodel.dll3.0.4506.5804442,36802-Apr-201222:31x86
System.runtime.serialization.dll3.0.4506.5804970,75202-Apr-201222:31x86
System.runtime.serialization.dll3.0.4506.5804970,75202-Apr-201222:31x86
System.servicemodel.dll3.0.4506.58045,992,44802-Apr-201222:31x86
System.servicemodel.washosting.dll3.0.4506.580432,76802-Apr-201222:31x86
System.servicemodel.dll3.0.4506.58045,992,44802-Apr-201222:31x86
Servicemonikersupport.dll3.0.4506.580418,01602-Apr-201222:31x86
System.identitymodel.dll3.0.4506.5804442,36802-Apr-201222:31x86
System.runtime.serialization.dll3.0.4506.5804970,75202-Apr-201222:31x86
System.servicemodel.dll3.0.4506.58045,992,44802-Apr-201222:31x86

For the .NET Framework 4

For all supported x86-based versions of Windows XP, of Windows Server 2003, of Windows Vista, of Windows Server 2008, and of Windows 7
File nameFile versionFile sizeDateTimePlatform
System.identitymodel.dll4.0.30319.565398,43206-Apr-201207:17x86
System.servicemodel.dll4.0.30319.5656,115,42406-Apr-201207:17x86
For all supported x64-based versions of Windows XP, of Windows Server 2003, of Windows Vista, of Windows Server 2008, of Windows 7, and of Windows Server 2008 R2
File nameFile versionFile sizeDateTimePlatform
System.identitymodel.dll4.0.30319.565398,43206-Apr-201207:17x86
System.servicemodel.dll4.0.30319.5656,115,42406-Apr-201207:17x86
For all supported Itanium-based versions of Windows XP, of Windows Server 2003, of Windows Vista, of Windows Server 2008, of Windows 7, and of Windows Server 2008 R2
File nameFile versionFile sizeDateTimePlatform
System.identitymodel.dll4.0.30319.565398,43206-Apr-201207:17x86
System.servicemodel.dll4.0.30319.5656,115,42406-Apr-201207:17x86

Workaround


To work around this issue, change the version of the assembly in the configuration file instead of using assembly redirection. However, this workaround does not resolve the issue in all scenarios. We recommend that you apply the hotfix to resolve the issue that is described in the "Symptoms" section.

Status


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.