Skip to content

Commit

Permalink
Merge pull request #1207 from nunit/issue-1206
Browse files Browse the repository at this point in the history
Ensure that agent path is quoted when launching it
  • Loading branch information
CharliePoole authored Aug 11, 2022
2 parents f2564da + 1814fda commit a55acb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/NUnitEngine/nunit.engine/Services/AgentProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public AgentProcess(TestAgency agency, TestPackage package, Guid agentId)
StartInfo.FileName = RuntimeFramework.MonoExePath;
string monoOptions = "--runtime=v" + TargetRuntime.ClrVersion.ToString(3);
monoOptions += " --debug";
StartInfo.Arguments = string.Format("{0} \"{1}\" {2}", monoOptions, AgentExePath, AgentArgs);
StartInfo.Arguments = $"{monoOptions} \"{AgentExePath}\" {AgentArgs}";
}
else if (TargetRuntime.Runtime == RuntimeType.Net)
{
Expand All @@ -64,7 +64,7 @@ public AgentProcess(TestAgency agency, TestPackage package, Guid agentId)
else if (TargetRuntime.Runtime == RuntimeType.NetCore)
{
StartInfo.FileName = "dotnet";
StartInfo.Arguments = $"{AgentExePath} {AgentArgs}";
StartInfo.Arguments = $"\"{AgentExePath}\" {AgentArgs}";
StartInfo.LoadUserProfile = loadUserProfile;

// TODO: Remove the windows limitation and the use of a hard-coded path.
Expand Down

0 comments on commit a55acb3

Please sign in to comment.