diff options
author | Jan Kotas <jkotas@microsoft.com> | 2015-10-29 19:09:52 -0700 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2015-10-29 19:09:52 -0700 |
commit | a8192fbc7064ed96cfeb8872bcb6479c217f7b5f (patch) | |
tree | 738c092202d3ce5c7ed4ec08114c3c41b7b005d8 /src/mscorlib | |
parent | 3c50dec5796206c6042fd6adc3133a0ad22649e5 (diff) | |
download | coreclr-a8192fbc7064ed96cfeb8872bcb6479c217f7b5f.tar.gz coreclr-a8192fbc7064ed96cfeb8872bcb6479c217f7b5f.tar.bz2 coreclr-a8192fbc7064ed96cfeb8872bcb6479c217f7b5f.zip |
Port .NET Framework 4.6.1 changes
Core runtime and GC changes from https://github.com/Microsoft/dotnet/blob/master/docs/releases/net461/dotnet461-changes.md that are not in CoreCLR yet
[tfs-changeset: 1543382]
Diffstat (limited to 'src/mscorlib')
5 files changed, 20 insertions, 40 deletions
diff --git a/src/mscorlib/src/System/AppContext/AppContext.cs b/src/mscorlib/src/System/AppContext/AppContext.cs index d1416f7af1..feef21b787 100644 --- a/src/mscorlib/src/System/AppContext/AppContext.cs +++ b/src/mscorlib/src/System/AppContext/AppContext.cs @@ -26,7 +26,9 @@ namespace System #endif get { - return AppDomain.CurrentDomain.BaseDirectory; + // The value of APP_CONTEXT_BASE_DIRECTORY key has to be a string and it is not allowed to be any other type. + // Otherwise the caller will get invalid cast exception + return (string) AppDomain.CurrentDomain.GetData("APP_CONTEXT_BASE_DIRECTORY") ?? AppDomain.CurrentDomain.BaseDirectory; } } diff --git a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs index 38085b8d4f..f15cb00198 100644 --- a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs +++ b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs @@ -84,10 +84,9 @@ namespace System.Collections.Concurrent // that generate collisions. Whenever a GrowTable() should be the only place that changes this #if !FEATURE_CORECLR // The field should be have been marked as NonSerialized but because we shipped it without that attribute in 4.5.1. - // we have to also add the OptionalField attribute to prevent cases where the field was serialized and we try to deserialize it after the fix. - // See DevDiv:899074 for more information + // we can't add it back without breaking compat. To maximize compat we are going to keep the OptionalField attribute + // This will prevent cases where the field was not serialized. [OptionalField] - [NonSerialized] #endif private int m_keyRehashCount; diff --git a/src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/SimpleTypeInfos.cs b/src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/SimpleTypeInfos.cs index 6490a3a2dd..461ed76a0f 100644 --- a/src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/SimpleTypeInfos.cs +++ b/src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/SimpleTypeInfos.cs @@ -656,7 +656,7 @@ namespace System.Diagnostics.Tracing public override object GetData(object value) { - return (Byte)value; + return value; } } @@ -678,7 +678,7 @@ namespace System.Diagnostics.Tracing public override object GetData(object value) { - return (SByte)value; + return value; } } @@ -700,7 +700,7 @@ namespace System.Diagnostics.Tracing public override object GetData(object value) { - return (Int16)value; + return value; } } @@ -722,7 +722,7 @@ namespace System.Diagnostics.Tracing public override object GetData(object value) { - return (UInt16)value; + return value; } } @@ -744,7 +744,7 @@ namespace System.Diagnostics.Tracing public override object GetData(object value) { - return (Int32)value; + return value; } } @@ -766,7 +766,7 @@ namespace System.Diagnostics.Tracing public override object GetData(object value) { - return (UInt32)value; + return value; } } @@ -788,7 +788,7 @@ namespace System.Diagnostics.Tracing public override object GetData(object value) { - return (Int64)value; + return value; } } @@ -810,7 +810,7 @@ namespace System.Diagnostics.Tracing public override object GetData(object value) { - return (UInt64)value; + return value; } } diff --git a/src/mscorlib/src/System/Globalization/CultureData.cs b/src/mscorlib/src/System/Globalization/CultureData.cs index 9911ef35cf..fa8926bfaf 100644 --- a/src/mscorlib/src/System/Globalization/CultureData.cs +++ b/src/mscorlib/src/System/Globalization/CultureData.cs @@ -1180,24 +1180,10 @@ namespace System.Globalization if (this.sLocalizedDisplayName == null) { #if !FEATURE_CORECLR - if (this.IsSupplementalCustomCulture) + String resourceKey = "Globalization.ci_" + this.sName; + if (IsResourcePresent(resourceKey)) { - if (this.IsNeutralCulture) - { - this.sLocalizedDisplayName = this.SNATIVELANGUAGE; - } - else - { - this.sLocalizedDisplayName = this.SNATIVEDISPLAYNAME; - } - } - else - { - String resourceKey = "Globalization.ci_" + this.sName; - if (IsResourcePresent(resourceKey)) - { - this.sLocalizedDisplayName = Environment.GetResourceString(resourceKey); - } + this.sLocalizedDisplayName = Environment.GetResourceString(resourceKey); } #endif // If it hasn't been found (Windows 8 and up), fallback to the system @@ -1518,17 +1504,10 @@ namespace System.Globalization if (this.sLocalizedCountry == null) { #if !FEATURE_CORECLR - if (this.IsSupplementalCustomCulture) - { - this.sLocalizedCountry = SNATIVECOUNTRY; - } - else + String resourceKey = "Globalization.ri_" + this.SREGIONNAME; + if (IsResourcePresent(resourceKey)) { - String resourceKey = "Globalization.ri_" + this.SREGIONNAME; - if (IsResourcePresent(resourceKey)) - { - this.sLocalizedCountry = Environment.GetResourceString(resourceKey); - } + this.sLocalizedCountry = Environment.GetResourceString(resourceKey); } #endif // If it hasn't been found (Windows 8 and up), fallback to the system diff --git a/src/mscorlib/src/mscorlib.txt b/src/mscorlib/src/mscorlib.txt index 6435d1c85d..2298b2065d 100644 --- a/src/mscorlib/src/mscorlib.txt +++ b/src/mscorlib/src/mscorlib.txt @@ -2647,7 +2647,7 @@ Globalization.ci_ewo = Ewondo Globalization.ci_ewo-CM = Ewondo (Cameroon) Globalization.ci_fa = Persian Globalization.ci_fa-AF = Persian (Afghanistan) -Globalization.ci_fa-IR = Persian +Globalization.ci_fa-IR = Persian (Iran) Globalization.ci_ff = Fulah Globalization.ci_ff-CM = Fulah (Cameroon) Globalization.ci_ff-GN = Fulah (Guinea) |