diff --git a/src/libraries/System.Private.CoreLib/src/System/AppContext.cs b/src/libraries/System.Private.CoreLib/src/System/AppContext.cs index b7756bb3f6669e..d0ab3305bfd4bc 100644 --- a/src/libraries/System.Private.CoreLib/src/System/AppContext.cs +++ b/src/libraries/System.Private.CoreLib/src/System/AppContext.cs @@ -141,24 +141,24 @@ public static void SetSwitch(string switchName, bool isEnabled) } } -#if !NATIVEAOT - internal static unsafe void Setup(char** pNames, char** pValues, int count) +#if MONO + internal static unsafe void Setup(char** pNames, uint* pNameLengths, char** pValues, uint* pValueLengths, int count) { Debug.Assert(s_dataStore == null, "s_dataStore is not expected to be inited before Setup is called"); s_dataStore = new Dictionary(count); for (int i = 0; i < count; i++) { - s_dataStore.Add(new string(pNames[i]), new string(pValues[i])); + s_dataStore.Add(new string(pNames[i], 0, (int)pNameLengths[i]), new string(pValues[i], 0, (int)pValueLengths[i])); } } - - internal static unsafe void Setup(char** pNames, uint* pNameLengths, char** pValues, uint* pValueLengths, int count) +#elif !NATIVEAOT + internal static unsafe void Setup(char** pNames, char** pValues, int count) { Debug.Assert(s_dataStore == null, "s_dataStore is not expected to be inited before Setup is called"); s_dataStore = new Dictionary(count); for (int i = 0; i < count; i++) { - s_dataStore.Add(new string(pNames[i], 0, (int)pNameLengths[i]), new string(pValues[i], 0, (int)pValueLengths[i])); + s_dataStore.Add(new string(pNames[i]), new string(pValues[i])); } } #endif