Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

StringComparison.InvariantCulture/InvariantCultureIgnoreCase are missing from System.Runtime Reference Assembly #17752

Closed
xyziemba opened this issue Jul 1, 2016 · 2 comments
Assignees
Milestone

Comments

@xyziemba
Copy link
Contributor

xyziemba commented Jul 1, 2016

InvariantCulture and InvairantCultureIgnoreCase aren't present on System.StringComparison, but appear to be implemented and used in tests. I would expect them to be present, but perhaps this is an intentional omission for some reason I don't understand?

StringComparison def: https://github.com/dotnet/corefx/blob/72f546c30e61b485546d7c5c0397b8ccc406efa4/src/System.Runtime/ref/System.Runtime.cs#L1626

Code using InvariantCulture/InvariantCultureIgnoreCase by casting an int:
https://github.com/dotnet/corefx/blob/72f546c30e61b485546d7c5c0397b8ccc406efa4/src/System.Runtime/tests/System/StringTests.cs#L433

@danmoseley danmoseley self-assigned this Jul 2, 2016
@danmoseley
Copy link
Member

These were not included in Core because of the following reason

It is almost always incorrect to using InvariantCulture for string equality, see http://msdn.microsoft.com/en-us/library/dd465121(v=vs.110).aspx. The most common replacement is StringComparison.OrdinalIgnoreCase, otherwise, if you need InvariantCulture, use CultureInfo.InvariantCulture.ComparerInfo.GetStringComparer(CompareOptions).

However, we will bring these back for compatibility with existing code.

@danmoseley danmoseley assigned hann013 and unassigned danmoseley Jul 4, 2016
@hann013
Copy link
Contributor

hann013 commented Jul 13, 2016

Completed - dotnet/corefx#10019 merged.

@hann013 hann013 closed this as completed Jul 13, 2016
blumu referenced this issue in microsoft/fsharplu Aug 28, 2017
…FSharpLu

Replaced `StringComparison.InvariantCultureIgnoreCase` by `StringComparison.OrdinalIgnoreCase` See
https://github.com/dotnet/corefx/issues/9801
dotnet/corefx#10019

Move out from FSharpLu all the NETFramework specific helpers: ConsoleTraceListener, Security impersonation. Moved them instead into a new package `Microsoft.FSharpLu.Windows`
blumu referenced this issue in microsoft/fsharplu Aug 29, 2017
…FSharpLu

FsharpLu targets netstandard2.0;net452;net461
FsharpLu.Json targets netstandard1.6;netstandard2.0;net452;net461
FSharpLu.Tests targets netstandard2.0;net452;net461

Replaced `StringComparison.InvariantCultureIgnoreCase` by `StringComparison.OrdinalIgnoreCase` See
https://github.com/dotnet/corefx/issues/9801
dotnet/corefx#10019

Move out from FSharpLu all the NETFramework specific helpers: ConsoleTraceListener, Security impersonation. Moved them instead into a new package `Microsoft.FSharpLu.Windows`
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 1.1.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 30, 2020
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants