diff --git a/utbot-rider/src/dotnet/UtBot/UtBot/ProcessWithRdServer.cs b/utbot-rider/src/dotnet/UtBot/UtBot/ProcessWithRdServer.cs index 3cfcd81c25..24d054c577 100644 --- a/utbot-rider/src/dotnet/UtBot/UtBot/ProcessWithRdServer.cs +++ b/utbot-rider/src/dotnet/UtBot/UtBot/ProcessWithRdServer.cs @@ -26,7 +26,7 @@ public class ProcessWithRdServer private Process _process; private ILogger _logger = Logger.GetLogger(); - public ProcessWithRdServer(string name, int port, string exePath, IShellLocks shellLocks, Lifetime? parent = null) + public ProcessWithRdServer(string name, string workingDir, int port, string exePath, IShellLocks shellLocks, Lifetime? parent = null) { using var blockingCollection = new BlockingCollection(2); shellLocks.AssertNonMainThread(); @@ -41,7 +41,9 @@ public ProcessWithRdServer(string name, int port, string exePath, IShellLocks sh var wire = new SocketWire.Server(Lifetime, scheduler, socket); var serializers = new Serializers(); var identities = new Identities(IdKind.Server); - var startInfo = new ProcessStartInfo("dotnet", $"{exePath} {port}"); + var startInfo = new ProcessStartInfo("dotnet", $"\"{exePath}\" {port}"); + + startInfo.WorkingDirectory = workingDir; Protocol = new Protocol(name, serializers, identities, scheduler, wire, Lifetime); scheduler.Queue(() => { diff --git a/utbot-rider/src/dotnet/UtBot/UtBot/UnitTestBuilder.cs b/utbot-rider/src/dotnet/UtBot/UtBot/UnitTestBuilder.cs index 41141304f8..2c57d745ab 100644 --- a/utbot-rider/src/dotnet/UtBot/UtBot/UnitTestBuilder.cs +++ b/utbot-rider/src/dotnet/UtBot/UtBot/UnitTestBuilder.cs @@ -119,7 +119,7 @@ private void Generate(IBackgroundProgressIndicator progressIndicator, IProject p _logger.Catch(() => { var port = NetworkUtil.GetFreePort(); - var proc = new ProcessWithRdServer(VSharpMain.VSharpProcessName, port, vsharpRunner.FullPath, + var proc = new ProcessWithRdServer(VSharpMain.VSharpProcessName, project.ProjectFileLocation.FullPath, port, vsharpRunner.FullPath, project.Locks, _lifetime); var projectCsprojPath = project.ProjectFileLocation.FullPath; @@ -192,4 +192,4 @@ private static string calculateTestProjectTarget(TargetFrameworkId tfm) return "net6.0"; } -} \ No newline at end of file +}