Determines whether the common language runtime uses the legacy 64-bit JIT compiler for just-in-time compilation.
<useLegacyJit enabled=0|1 />
The element name
useLegacyJit is case-sensitive.
Attributes and elements
The following sections describe attributes, child elements, and parent elements.
Specifies whether the runtime uses the legacy 64-bit JIT compiler.
|0||The common language runtime uses the new 64-bit JIT compiler included in the .NET Framework 4.6 and later versions.|
|1||The common language runtime uses the older 64-bit JIT compiler.|
||The root element in every configuration file used by the common language runtime and .NET Framework applications.|
||Contains information about runtime initialization options.|
Starting with the .NET Framework 4.6, the common language runtime uses a new 64-bit compiler for Just-In-Time (JIT) compilation by default. In some cases, this may result in a difference in behavior from application code that was JIT-compiled by the previous version of the 64-bit JIT compiler. By setting the
enabled attribute of the
<useLegacyJit> element to
1, you can disable the new 64-bit JIT compiler and instead compile your app using the legacy 64-bit JIT compiler.
<useLegacyJit> element affects 64-bit JIT compilation only. Compilation with the 32-bit JIT compiler is unaffected.
Instead of using a configuration file setting, you can enable the legacy 64-bit JIT compiler in two other ways:
Setting an environment variable
COMPLUS_useLegacyJitenvironment variable to either
0(use the new 64-bit JIT compiler) or
1(use the older 64-bit JIT compiler):
The environment variable has global scope, which means that it affects all applications run on the machine. If set, it can be overridden by the application configuration file setting. The environment variable name is not case-sensitive.
Adding a registry key
You can enable the legacy 64-bit JIT compiler by adding a
REG_DWORDvalue to either the
HKEY_CURRENT_USER\SOFTWARE\Microsoft\.NETFrameworkkey in the registry. The value is named
useLegacyJit. If the value is 0, the new compiler is used. If the value is 1, the legacy 64-bit JIT compiler is enabled. The registry value name is not case-sensitive.
Adding the value to the
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFrameworkkey affects all apps running on the machine. Adding the value to the
HKEY_CURRENT_USER\SOFTWARE\Microsoft\.NETFrameworkkey affects all apps run by the current user. If a machine is configured with multiple user accounts, only apps run by the current user are affected, unless the value is added to the registry keys for other users as well. Adding the
<useLegacyJit>element to a configuration file overrides the registry settings, if they're present.
The following configuration file disables compilation with the new 64-bit JIT compiler and instead uses the legacy 64-bit JIT compiler.
<?xml version ="1.0"?> <configuration> <runtime> <useLegacyJit enabled="1" /> </runtime> </configuration>
Send feedback about: