diff --git a/MonoGame.Framework.Content.Pipeline/ExternalTool.cs b/MonoGame.Framework.Content.Pipeline/ExternalTool.cs index e4a8768d800..ca5235e25bb 100644 --- a/MonoGame.Framework.Content.Pipeline/ExternalTool.cs +++ b/MonoGame.Framework.Content.Pipeline/ExternalTool.cs @@ -99,7 +99,7 @@ public static int Run(string command, string arguments, out string stdout, out s CreateNoWindow = true, WindowStyle = ProcessWindowStyle.Hidden, ErrorDialog = false, - FileName = fullPath, + FileName = $"\"{fullPath}\"", UseShellExecute = false, RedirectStandardOutput = true, RedirectStandardError = true, diff --git a/Tools/MonoGame.Content.Builder.Editor/Common/Util.cs b/Tools/MonoGame.Content.Builder.Editor/Common/Util.cs index 3053572ed3f..c791bd4eba2 100644 --- a/Tools/MonoGame.Content.Builder.Editor/Common/Util.cs +++ b/Tools/MonoGame.Content.Builder.Editor/Common/Util.cs @@ -65,13 +65,13 @@ public static Process CreateProcess(string command, string arguments, string wor if (command.EndsWith (".dll")) { // we are referencing the dll directly. We need to call dotnet to host. exe = Global.Unix ? "dotnet" : "dotnet.exe"; - args = $"{command} {arguments}"; + args = $"\"{command}\" {arguments}"; } var _buildProcess = new Process { StartInfo = new ProcessStartInfo { - FileName = exe, + FileName = $"\"{exe}\"", Arguments = args, WorkingDirectory = workingDirectory, CreateNoWindow = true, diff --git a/Tools/MonoGame.Tools.Tests/BuilderTargetsTest.cs b/Tools/MonoGame.Tools.Tests/BuilderTargetsTest.cs index 990d3c9d61a..22cf0bf3361 100644 --- a/Tools/MonoGame.Tools.Tests/BuilderTargetsTest.cs +++ b/Tools/MonoGame.Tools.Tests/BuilderTargetsTest.cs @@ -72,11 +72,11 @@ public void BuildSimpleProject() Directory.Delete(outputPath, recursive: true); var result = RunBuild("dotnet", Path.Combine(root, "Assets", "Projects", "BuildSimpleProject.csproj"), new string[] { - "-p:MGCBCommand=" + Path.Combine(root, "mgcb.dll") + $"-p:MGCBCommand=\"{Path.Combine(root, "mgcb.dll")}\"" }); Assert.AreEqual(true, result, "Content Build should have succeeded."); var contentFont = Path.Combine(outputPath, "DesktopGL", "Content", "ContentFont.xnb"); - Assert.IsTrue(File.Exists(contentFont), "'" + contentFont + "' should exist."); + Assert.IsTrue(File.Exists(contentFont), $"'{contentFont}' should exist."); } } }