Sign in with Microsoft
Sign in or create an account.
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.


Assume that you have upgraded to Microsoft .NET Framework 4.6 on your computer. When you use an application that uses Windows Communication Framework (WCF) to send XML SOAP messages, the encoding may take slightly longer. In some cases, this might affect the rate at which a server application can process requests.


This issue occurs because of a new Just-In-Time (JIT) compiler that is named RyuJIT. This compiler uses different optimizations than the legacy JIT64 compiler. A method on a hot code path for encoding strings in the XmlDictionaryWriter is not optimized for the new JIT compiler and the generated native instructions run slower and the encoding takes longer. When a SOAP message contains a large number of strings to be encoded, this slower code is used more frequently and may affect the encoding time.


To work around this issue, configure the application to disable the use of ngen for the System.Runtime.Serialization.dll assembly and to use the legacy JIT engine. To do this, use one of the following methods:

  • Set the following environment variables:


  • In the registry, create either of the following subkeys:


    Then, add the following values:

    • Key name: useLegacyJit
      Type: REG_WORD
      Value: 1

    • Key name: DisableNativeImageLoadList
      Type: REG_SZ   
      Value: System.Runtime.Serialization

  • Add the following text to the <app>.exe.config file . Create the indicated sections if they do not already exist.<configuration>
    <useLegacyJit enabled="1">
    <assemblyIdentity name="System.Runtime.Serialization" />

For more information about the known issues in the .NET Framework 4.6, see Known issues for the .NET Framework 4.6.

More Information

For more information about the product versioning changes and their effects in the .NET Framework 4.6, see Application Compatibility in the .NET Framework 4.6.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!