diff options
author | Tomas Rylek <trylek@microsoft.com> | 2015-11-26 04:42:49 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2015-11-30 22:16:02 +0300 |
commit | a9d32b96bc6aa708d660afe674c129bff61d257c (patch) | |
tree | 1f276a6d86d0aaa9b9aed86ffa840f3e639b212a /src/System.Private.CoreLib | |
parent | 06640779c0e4d9ee2c921860b4d1a79a9524b424 (diff) |
Fix assembly name formatting to use invariant culture
[tfs-changeset: 1552187]
Diffstat (limited to 'src/System.Private.CoreLib')
-rw-r--r-- | src/System.Private.CoreLib/src/System/Version.cs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/System.Private.CoreLib/src/System/Version.cs b/src/System.Private.CoreLib/src/System/Version.cs index 5350f9163..25dd1be14 100644 --- a/src/System.Private.CoreLib/src/System/Version.cs +++ b/src/System.Private.CoreLib/src/System/Version.cs @@ -268,20 +268,20 @@ namespace System case 0: return (String.Empty); case 1: - return (String.Concat(_Major)); + return (FormatComponent(_Major)); case 2: - return (String.Concat(_Major, ".", _Minor)); + return (String.Concat(FormatComponent(_Major), ".", FormatComponent(_Minor))); default: if (_Build == -1) throw new ArgumentException(SR.Format(SR.ArgumentOutOfRange_Bounds_Lower_Upper, "0", "2"), "fieldCount"); if (fieldCount == 3) - return (_Major + "." + _Minor + "." + _Build); + return (FormatComponent(_Major) + "." + FormatComponent(_Minor) + "." + FormatComponent(_Build)); if (_Revision == -1) throw new ArgumentException(SR.Format(SR.ArgumentOutOfRange_Bounds_Lower_Upper, "0", "3"), "fieldCount"); if (fieldCount == 4) - return (Major + "." + _Minor + "." + _Build + "." + _Revision); + return (FormatComponent(Major) + "." + FormatComponent(_Minor) + "." + FormatComponent(_Build) + "." + FormatComponent(_Revision)); throw new ArgumentException(SR.Format(SR.ArgumentOutOfRange_Bounds_Lower_Upper, "0", "4"), "fieldCount"); } @@ -393,6 +393,15 @@ namespace System return true; } + /// <summary> + /// Format a version component using culture-invariant formatting. + /// </summary> + /// <param name="component">A numeric component of the version number</param> + private static string FormatComponent(int component) + { + return component.ToString(FormatProvider.InvariantCulture); + } + public static bool operator ==(Version v1, Version v2) { if (Object.ReferenceEquals(v1, null)) |