-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
dotnet/coreclr
#26605Labels
area-System.GlobalizationenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsos-windowstracking-external-issueThe issue is caused by external problem (e.g. OS) - nothing we can do to fix it directlyThe issue is caused by external problem (e.g. OS) - nothing we can do to fix it directly
Milestone
Description
Repro
dotnet new console
Use this code in Main
string value = @"Some";
IEqualityComparer<string> comparer = StringComparer.InvariantCulture;
Console.WriteLine($"{comparer.GetHashCode(value)}");Build with .NET Core 3.0.
Go to the output folder and set compatibility mode for the .exe to Windows 7.
Run the exe.
Output
Unhandled exception. System.ArgumentException: External component has thrown an exception.
at System.Globalization.CompareInfo.GetHashCodeOfStringCore(ReadOnlySpan`1 source, CompareOptions options)
at System.Globalization.CompareInfo.GetHashCodeOfString(String source, CompareOptions options)
at System.CultureAwareComparer.GetHashCode(String obj)
at ConsoleApp3.Program.Main(String[] args)
This seems to happen for any string other than empty string. The program works fine when executed without the compatibility mode set.
I haven't tried to run this on actual Windows 7 machine.
Sewer56
Metadata
Metadata
Assignees
Labels
area-System.GlobalizationenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsos-windowstracking-external-issueThe issue is caused by external problem (e.g. OS) - nothing we can do to fix it directlyThe issue is caused by external problem (e.g. OS) - nothing we can do to fix it directly