Merge pull request #1738 from dotnet/nimullen/createloadcontextfix
Add ability to specify `outputPath` when creating a `ProjectContext`s `AssemblyLoadContext`.
This commit is contained in:
commit
2f2b3df35b
1 changed files with 5 additions and 2 deletions
|
@ -10,7 +10,10 @@ namespace Microsoft.DotNet.ProjectModel.Loader
|
|||
{
|
||||
public static class LoaderProjectContextExtensions
|
||||
{
|
||||
public static AssemblyLoadContext CreateLoadContext(this ProjectContext context, string configuration = "Debug")
|
||||
public static AssemblyLoadContext CreateLoadContext(
|
||||
this ProjectContext context,
|
||||
string configuration = "Debug",
|
||||
string outputPath = null)
|
||||
{
|
||||
var exporter = context.CreateExporter(configuration);
|
||||
var assemblies = new Dictionary<AssemblyName, string>(AssemblyNameComparer.OrdinalIgnoreCase);
|
||||
|
@ -38,7 +41,7 @@ namespace Microsoft.DotNet.ProjectModel.Loader
|
|||
dllImports,
|
||||
|
||||
// Add the project's output directory path to ensure project-to-project references get located
|
||||
new[] { context.GetOutputPaths(configuration).CompilationOutputPath });
|
||||
new[] { context.GetOutputPaths(configuration, outputPath: outputPath).CompilationOutputPath });
|
||||
}
|
||||
|
||||
private class AssemblyNameComparer : IEqualityComparer<AssemblyName>
|
||||
|
|
Loading…
Add table
Reference in a new issue