Skip to content

Commit d72e965

Browse files
CopilotmarcpopMSFT
andcommitted
Add clarifying comment about backward compatibility for path normalization
Co-authored-by: marcpopMSFT <[email protected]>
1 parent 8eb2ee5 commit d72e965

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Cli/dotnet/Commands/Run/RunCommand.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,10 @@ internal static void ThrowUnableToRunError(ProjectInstance project)
529529
projectFileOrDirectoryPath = Directory.GetCurrentDirectory();
530530
}
531531

532-
// Normalize path separators to handle Windows-style paths on non-Windows platforms
533-
// First convert backslashes to forward slashes on non-Windows, then get the full path
532+
// Normalize path separators to handle Windows-style paths on non-Windows platforms.
533+
// This is supported for backward compatibility in 'dotnet run' only, not for all CLI commands.
534+
// Converting backslashes to forward slashes allows PowerShell scripts using Windows-style paths
535+
// to work cross-platform, maintaining compatibility with .NET 9 behavior.
534536
if (Path.DirectorySeparatorChar != '\\')
535537
{
536538
projectFileOrDirectoryPath = projectFileOrDirectoryPath.Replace('\\', '/');

0 commit comments

Comments
 (0)