Skip to content

Commit 4f506a7

Browse files
authored
Update named pipe for dotnet test (#49936)
1 parent fc81ab9 commit 4f506a7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Cli/dotnet/Commands/Test/IPC/NamedPipeServer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public static PipeNameDescription GetPipeName(string name)
252252
return new PipeNameDescription($"testingplatform.pipe.{name.Replace('\\', '.')}", false);
253253
}
254254

255-
string directoryId = Path.Combine(Path.GetTempPath(), name);
255+
string directoryId = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), name);
256256
Directory.CreateDirectory(directoryId);
257257
return new PipeNameDescription(
258258
!Directory.Exists(directoryId)

src/Cli/dotnet/Commands/Test/TestApplication.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Microsoft.DotNet.Cli.Commands.Test.IPC;
99
using Microsoft.DotNet.Cli.Commands.Test.IPC.Models;
1010
using Microsoft.DotNet.Cli.Commands.Test.IPC.Serializers;
11+
using Microsoft.DotNet.Cli.Utils;
1112

1213
namespace Microsoft.DotNet.Cli.Commands.Test;
1314

@@ -105,7 +106,7 @@ private string GetArguments(TestOptions testOptions)
105106
? args.Aggregate((a, b) => $"{a} {b}")
106107
: string.Empty);
107108

108-
builder.Append($" {CliConstants.ServerOptionKey} {CliConstants.ServerOptionValue} {CliConstants.DotNetTestPipeOptionKey} {_pipeNameDescription.Name}");
109+
builder.Append($" {CliConstants.ServerOptionKey} {CliConstants.ServerOptionValue} {CliConstants.DotNetTestPipeOptionKey} {ArgumentEscaper.EscapeSingleArg(_pipeNameDescription.Name)}");
109110

110111
return builder.ToString();
111112
}

0 commit comments

Comments
 (0)