TinyIoC icon indicating copy to clipboard operation
TinyIoC copied to clipboard

Using the wrong string comparison

Open davkean opened this issue 14 years ago • 3 comments
trafficstars

Attempting to compile this under Portable Library, I noticed that you are using the wrong string comparison - you're using InvariantCulture instead of Ordinal. Common mistake - hence why we removed it from Portable (and will be removed from .NET for Metro apps if it hasn't already been).

Think of InvariantCulture as en-US that basically doesn't change from .NET version to version, whereas ordinal is a byte-to-byte comparison. An example of two methods names that will be considered equal using invariant are 'encyclopaedia' and 'encyclopædia' despite the runtime considering them as different.

Feel free to ping offline if you would like more information.

David Kean david DOT kean AT microsoft DOT com

davkean avatar Oct 05 '11 05:10 davkean

You're right, thanks, this is a mistake I noticed when I started the WinRT port. That port is in another branch if you're interested.

grumpydev avatar Oct 05 '11 05:10 grumpydev

What's the state of the WinRT port? It seems to compile after a couple tweaks (mostly dealing with IsGenericType errors) but would you consider it usable?

oliverw avatar Apr 14 '12 16:04 oliverw

There's a winrt branch that seems to work, but hasn't been extensively tested.

grumpydev avatar Apr 14 '12 16:04 grumpydev