Skip to content

Commit 0a89523

Browse files
committed
Replace compile-time check for .NET Core with runtime check
1 parent 6fa07db commit 0a89523

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/PowerShellEditorServices/Workspace/Workspace.cs

+6-5
Original file line numberDiff line numberDiff line change
@@ -714,11 +714,12 @@ public static string ConvertPathToDocumentUri(string path)
714714
docUriStrBld.Append(escapedPath).Replace("%2F", "/");
715715
}
716716

717-
#if !CoreCLR
718-
// ' is not encoded by Uri.EscapeDataString in Windows PowerShell 5.x.
719-
// This is apparently a difference between .NET Framework and .NET Core.
720-
docUriStrBld.Replace("'", "%27");
721-
#endif
717+
if (!Utils.IsNetCore)
718+
{
719+
// ' is not encoded by Uri.EscapeDataString in Windows PowerShell 5.x.
720+
// This is apparently a difference between .NET Framework and .NET Core.
721+
docUriStrBld.Replace("'", "%27");
722+
}
722723

723724
return docUriStrBld.ToString();
724725
}

0 commit comments

Comments
 (0)