diff --git a/src/Agent.Worker/Handlers/NodeHandler.cs b/src/Agent.Worker/Handlers/NodeHandler.cs index b96712c559..434fcafb30 100644 --- a/src/Agent.Worker/Handlers/NodeHandler.cs +++ b/src/Agent.Worker/Handlers/NodeHandler.cs @@ -130,6 +130,10 @@ public async Task RunAsync() string target = Data.Target; ArgUtil.NotNullOrEmpty(target, nameof(target)); target = Path.Combine(TaskDirectory, target); + + // Ensure the slashes are normalized, it's possible that the subpath inside the task is using / + // and the TaskDirectory is using \ on Windows. + target = Path.GetFullPath(target); ArgUtil.File(target, nameof(target)); // Resolve the working directory.