Element - .NET Framework (original) (raw)

Determines whether the common language runtime uses the legacy 64-bit JIT compiler for just-in-time compilation.



Syntax

<useLegacyJit enabled=0|1 />

The element name useLegacyJit is case-sensitive.

Attributes and elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description
enabled Required attribute.Specifies whether the runtime uses the legacy 64-bit JIT compiler.

enabled attribute

Value Description
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.

Child elements

None

Parent elements

Element Description
configuration The root element in every configuration file used by the common language runtime and .NET Framework applications.
runtime Contains information about runtime initialization options.

Starting with .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.

Note

The <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:

COMPLUS_useLegacyJit=0|1  

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.

Example

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>  

See also