diff --git a/src/Microsoft.DotNet.Tools.Compiler.Native/ILCompilerInvoker.cs b/src/Microsoft.DotNet.Tools.Compiler.Native/ILCompilerInvoker.cs index 201a37219..a7ea2e2a0 100644 --- a/src/Microsoft.DotNet.Tools.Compiler.Native/ILCompilerInvoker.cs +++ b/src/Microsoft.DotNet.Tools.Compiler.Native/ILCompilerInvoker.cs @@ -42,11 +42,11 @@ namespace Microsoft.DotNet.Tools.Compiler.Native var argsList = new List(); var managedPath = Path.Combine(config.IlcPath, ILCompiler); - argsList.Add(managedPath); + argsList.Add($"\"{managedPath}\""); // Input File var inputFilePath = config.InputManagedAssemblyPath; - argsList.Add(inputFilePath); + argsList.Add($"\"{inputFilePath}\""); // System.Private.CoreLib Reference var coreLibPath = Path.Combine(config.IlcPath, OSCoreLibNameMap[config.OS]); @@ -103,4 +103,4 @@ namespace Microsoft.DotNet.Tools.Compiler.Native } } -} \ No newline at end of file +} diff --git a/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Windows/WindowsLinkStep.cs b/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Windows/WindowsLinkStep.cs index 91b59ee74..446d2a52c 100644 --- a/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Windows/WindowsLinkStep.cs +++ b/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Windows/WindowsLinkStep.cs @@ -102,14 +102,15 @@ namespace Microsoft.DotNet.Tools.Compiler.Native var SDKLibs = ModeLibMap[config.NativeMode]; foreach (var lib in SDKLibs) { - argsList.Add(Path.Combine(config.IlcPath, lib)); + var sdkLibPath = Path.Combine(config.IlcPath, lib); + argsList.Add($"\"{sdkLibPath}\""); } // Configuration Based Libs var configLibs = ConfigurationLinkLibMap[config.BuildType]; foreach (var lib in configLibs) { - argsList.Add(lib); + argsList.Add($"\"{lib}\""); } // Link Libs @@ -136,7 +137,6 @@ namespace Microsoft.DotNet.Tools.Compiler.Native .ForwardStdErr() .ForwardStdOut() .Execute(); - return result.ExitCode; } @@ -163,4 +163,4 @@ namespace Microsoft.DotNet.Tools.Compiler.Native } } -} \ No newline at end of file +}