diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs b/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs index 3428962a81..db582510a3 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs @@ -154,7 +154,17 @@ namespace GodotTools.Build arguments.Add(buildInfo.OnlyClean ? "clean" : "build"); // C# Project - arguments.Add(buildInfo.Project); + string projectPath = buildInfo.Project; + if (OperatingSystem.IsWindows()) + { + // On Windows, when using a network share path, the path may start with "//" + // which MSBuild will treat like a switch. Convert to "\\" to make it an absolute path. + if (projectPath.StartsWith("//")) + { + projectPath = "\\\\" + projectPath.Substring(2); + } + } + arguments.Add(projectPath); // `dotnet clean` doesn't recognize these options if (!buildInfo.OnlyClean) @@ -195,7 +205,17 @@ namespace GodotTools.Build arguments.Add("publish"); // `dotnet publish` command // C# Project - arguments.Add(buildInfo.Project); + string projectPath = buildInfo.Project; + if (OperatingSystem.IsWindows()) + { + // On Windows, when using a network share path, the path may start with "//" + // which MSBuild will treat like a switch. Convert to "\\" to make it an absolute path. + if (projectPath.StartsWith("//")) + { + projectPath = "\\\\" + projectPath.Substring(2); + } + } + arguments.Add(projectPath); // Restore // `dotnet publish` restores by default, unless requested not to