Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Missing set_Id(System.String) method and "MissingMethodException" exception after you install a .NET Framework hotfix


Symptoms

Consider the following scenario:
  • You are running a Windows Communication Foundation (WCF)–based service project on a computer.
  • You install a Microsoft .NET Framework hotfix that contains only a System.ServiceModel.dll file or a System.IdentityModel.dll file.
  • You try to access the WCF service.
In this scenario, you may encounter the following exception:

Exception type: System.MissingMethodException

Message: Method not found: 'Void System.IdentityModel.Tokens.SecurityKeyIdentifierClause.set_Id(System.String)'
CallStack:

at System.ServiceModel.Security.WSSecurityJan2004.SecurityTokenReferenceJan2004ClauseEntry.ReadKeyIdentifierClauseCore(XmlDictionaryReader reader)
at System.ServiceModel.Security.WSSecurityTokenSerializer.ReadKeyIdentifierClauseCore(XmlReader reader)
at System.IdentityModel.Selectors.SecurityTokenSerializer.ReadKeyIdentifierClause(XmlReader reader)
at System.ServiceModel.Security.WSSecureConversation.DerivedKeyTokenEntry.ReadDerivedKeyTokenParameters(XmlDictionaryReader reader, SecurityTokenResolver tokenResolver, String& id, String& derivationAlgorithm, String& label, Int32& length, Byte[]& nonce, Int32& offset, Int32& generation, SecurityKeyIdentifierClause& tokenToDeriveIdentifier, SecurityToken& tokenToDerive)
at System.ServiceModel.Security.WSSecureConversation.DerivedKeyTokenEntry.ReadTokenCore(XmlDictionaryReader reader, SecurityTokenResolver tokenResolver)
at System.ServiceModel.Security.WSSecurityTokenSerializer.ReadTokenCore(XmlReader reader, SecurityTokenResolver tokenResolver)
at System.IdentityModel.Selectors.SecurityTokenSerializer.ReadToken(XmlReader reader, SecurityTokenResolver tokenResolver)
at System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken(XmlReader reader, SecurityTokenResolver tokenResolver, IList`1 allowedTokenAuthenticators, SecurityTokenAuthenticator& usedTokenAuthenticator)
at System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken(XmlDictionaryReader reader, Int32 position, Byte[] decryptedBuffer, SecurityToken encryptionToken, String idInEncryptedForm, TimeSpan timeout)
at System.ServiceModel.Security.ReceiveSecurityHeader.ExecuteFullPass(XmlDictionaryReader reader)
at System.ServiceModel.Security.StrictModeSecurityHeaderElementInferenceEngine.ExecuteProcessingPasses(ReceiveSecurityHeader securityHeader, XmlDictionaryReader reader)
at System.ServiceModel.Security.ReceiveSecurityHeader.Process(TimeSpan timeout, ChannelBinding channelBinding, ExtendedProtectionPolicy extendedProtectionPolicy)
at System.ServiceModel.Security.MessageSecurityProtocol.ProcessSecurityHeader(ReceiveSecurityHeader securityHeader, Message& message, SecurityToken requiredSigningToken, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)
at System.ServiceModel.Security.SymmetricSecurityProtocol.VerifyIncomingMessageCore(Message& message, String actor, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)at System.ServiceModel.Security.MessageSecurityProtocol.VerifyIncomingMessage(Message& message, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates

↑ Back to the top


Cause

This issue occurs because of a mismatch in the versions of System.ServiceModel.dll and System.IdentityModel.dll.

Note This issue does not necessarily mean that the newly installed update is bad. The mismatch may have been introduced by an earlier Limited Distribution Release (LDR) update.

↑ Back to the top


Workaround

To work around this issue, install hotfix 2637518 (or, install another hotfix that can force both System.ServiceModel.dll and System.IdentityModel.dll to run on the same payload):
  • If the hotfix you installed is earlier than hotfix 2637518 , you can directly install hotfix 2637518 .
  • If the hotfix you installed is newer than hotfix 2637518 , perform the following steps:
    1. Uninstall your hotfix. To do this, follow these steps:
        1. Click Start, click Control Panel, and then click Program and Features.
        2. In the navigation pane, click View Installed Updates.
        3. Right-click this hotfix, and then click Uninstall.
    2. Install hotfix 2637518 .
    3. Install the new hotfix.

↑ Back to the top


More Information

Microsoft releases hotfixes in the following two branches or payloads:
  • The General Distribution (GDR) branch
  • The LDR branch
GDR hotfixes come through both branches, whereas LDR hotfixes come through only the LDR branch.

WCF hotfixes usually include both the System.ServiceModel.dll and System.IdentityModel.dll files. Occasionally, you have to add a reference to the System.IdentityModel assembly in a WCF service project in order to handle a security token. The System.IdentityModel.dll assembly should be on the same branch as System.ServiceModel.dll for both to work together correctly. Therefore, if System.ServiceModel.dll runs on the GDR branch, System.IdentityModel.dll should also be on the GDR branch. This also applies to the LDR branch.

For example, assume that you previously installed a Quick Fix Engineering (QFE) or LDR hotfix that includes only one of the two DLLs. In this situation, this hotfix causes that DLL to run on the LDR branch, and the other DLL will continue to run on the GDR branch. This causes a mismatch. If you install a GDR hotfix later, it will force the LDR .dll file on the LDR branch to stay on the LDR branch whereas the other DLL may stay on the GDR branch. Therefore, this mismatch breaks the dependency between System.ServiceModel.dll and System.IdentityModel.dll, and this causes the exception that’s described in the "Symptoms" section.

For more information about LDR and GDR, see the following Microsoft TechNet blog:

↑ Back to the top


Status

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

↑ Back to the top


Keywords: kbsurveynew, kbtshoot, kbexpertisebeginner, kb

↑ Back to the top

Article Info
Article ID : 2912193
Revision : 1
Created on : 1/7/2017
Published on : 5/26/2014
Exists online : False
Views : 47