Merge pull request #116071 from zinefer/bugfix-c-sharp-build-on-windows-network-share
Replace `//` with `\\` before sending project path to MSBuild
This commit is contained in:
commit
c6f1ad6b09
1 changed files with 22 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue