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
Key name: DisableNativeImageLoadList
Add the following text to the <app>.exe.config file . Create the indicated sections if they do not already exist.<configuration>
<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.
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.