<NetFx45_CultureAwareComparerGetHashCode_LongStrings> Element
Specifies whether the runtime uses a fixed amount of memory to calculate hash codes for the StringComparer.GetHashCode method.
<configuration>
<runtime>
<NetFx45_CultureAwareComparerGetHashCode_LongStrings>
Syntax
<NetFx45_CultureAwareComparerGetHashCode_LongStrings enabled="0|1">
Attributes and Elements
The following sections describe attributes, child elements, and parent elements.
Attributes
Attribute | Description |
---|---|
enabled |
Required attribute. Specifies whether the common language runtime allocates a fixed amount of memory when calculating hash codes. |
enabled Attribute
Value | Description |
---|---|
0 | The common language runtime allocates a variable amount of memory for the StringComparer.GetHashCode method to calculate hash codes. This is the default. |
1 | The common language runtime allocates a fixed amount of memory for the StringComparer.GetHashCode method to calculate hash codes. |
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. |
Remarks
By default, the common language runtime allocates a variable amount of memory for the StringComparer.GetHashCode method, and an ArgumentException can be thrown when the method attempts to compute the hash code of very large strings (over several million characters long). By adding this element to an application configuration file and setting its enabled
attribute to "1", you can specify that the StringComparer.GetHashCode method use an alternate algorithm that allocates a fixed amount of memory for the computation of hash codes.
Important
The <NetFx45_CultureAwareComparerGetHashCode_LongStrings>
element is not used in Windows 8 and later versions.