From 87c815c6ffb2374a5063d633e5ae9dc8efe029de Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Fri, 7 Dec 2018 04:56:40 -0500 Subject: [PATCH] Fix Microsoft.IO.Redist compilation string.Create compilation failure Signed-off-by: dotnet-bot Commit migrated from https://github.com/dotnet/coreclr/commit/ff199cc9ac6cef3679918d2e88d5c19f8090593e --- src/libraries/System.Private.CoreLib/src/System/IO/Path.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/Path.cs b/src/libraries/System.Private.CoreLib/src/System/IO/Path.cs index 99cf202..3d510f4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/Path.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/Path.cs @@ -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)); } /// -- 2.7.4