Fix Microsoft.IO.Redist compilation string.Create compilation failure
authorStephen Toub <stoub@microsoft.com>
Fri, 7 Dec 2018 09:56:40 +0000 (04:56 -0500)
committerStephen Toub <stoub@microsoft.com>
Fri, 7 Dec 2018 16:09:43 +0000 (11:09 -0500)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
src/System.Private.CoreLib/shared/System/IO/Path.cs

index 99cf202..3d510f4 100644 (file)
@@ -234,8 +234,14 @@ namespace System.IO
         {
             byte* pKey = stackalloc byte[KeyLength];
             Interop.GetRandomBytes(pKey, KeyLength);
-            return string.Create(12, (IntPtr)pKey, (span, key) => // 12 == 8 + 1 (for period) + 3
-                Populate83FileNameFromRandomBytes((byte*)key, KeyLength, span));
+
+#if MS_IO_REDIST
+                return StringExtensions.Create(
+#else
+                return string.Create(
+#endif
+                    12, (IntPtr)pKey, (span, key) => // 12 == 8 + 1 (for period) + 3
+                         Populate83FileNameFromRandomBytes((byte*)key, KeyLength, span));
         }
 
         /// <summary>