diff --git a/src/Microsoft.DotNet.Tools.Compiler.Native/ILCompilerInvoker.cs b/src/Microsoft.DotNet.Tools.Compiler.Native/ILCompilerInvoker.cs index 35edbd667..c18ab8a70 100644 --- a/src/Microsoft.DotNet.Tools.Compiler.Native/ILCompilerInvoker.cs +++ b/src/Microsoft.DotNet.Tools.Compiler.Native/ILCompilerInvoker.cs @@ -45,9 +45,12 @@ namespace Microsoft.DotNet.Tools.Compiler.Native var inputFilePath = config.InputManagedAssemblyPath; argsList.Add($"\"{inputFilePath}\""); - // System.Private.CoreLib Reference - var coreLibPath = Path.Combine(config.IlcSdkPath, "sdk", "*.dll"); - argsList.Add($"-r \"{coreLibPath}\""); + // System.Private.* References + var coreLibsPath = Path.Combine(config.IlcSdkPath, "sdk"); + foreach (var reference in Directory.EnumerateFiles(coreLibsPath, "*.dll")) + { + argsList.Add($"-r \"{reference}\""); + } // AppDep References foreach (var reference in config.ReferencePaths) diff --git a/src/Microsoft.DotNet.Tools.Compiler.Native/NativeCompileSettings.cs b/src/Microsoft.DotNet.Tools.Compiler.Native/NativeCompileSettings.cs index c4f192797..16ac95456 100644 --- a/src/Microsoft.DotNet.Tools.Compiler.Native/NativeCompileSettings.cs +++ b/src/Microsoft.DotNet.Tools.Compiler.Native/NativeCompileSettings.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using Microsoft.DotNet.Cli.Utils; namespace Microsoft.DotNet.Tools.Compiler.Native @@ -80,12 +81,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native { get { - var referencePaths = new List(_referencePaths) - { - Path.Combine(AppDepSDKPath, "*.dll") - }; - - return referencePaths; + return _referencePaths; } } @@ -163,7 +159,6 @@ namespace Microsoft.DotNet.Tools.Compiler.Native private NativeCompileSettings() { _linkLibPaths = new List(); - _referencePaths = new List(); IlcPath = AppContext.BaseDirectory; @@ -173,6 +168,8 @@ namespace Microsoft.DotNet.Tools.Compiler.Native BuildType = DefaultBuiltType; NativeMode = DefaultNativeModel; AppDepSDKPath = Path.Combine(AppContext.BaseDirectory, "appdepsdk"); + + _referencePaths = new List(Directory.EnumerateFiles(AppDepSDKPath, "*.dll")); } public static NativeCompileSettings Default