Skip to content

Commit

Permalink
Merge pull request #6126 from brianrob/nuget-load-context
Browse files Browse the repository at this point in the history
Change Load Behavior for NuGet Components
  • Loading branch information
Forgind committed Feb 8, 2021
2 parents 8c20e24 + 183645c commit bba8fa9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Build/Utilities/NuGetFrameworkWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public NuGetFrameworkWrapper()
BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory;
try
{
var NuGetAssembly = Assembly.LoadFile(Path.Combine(assemblyDirectory, "NuGet.Frameworks.dll"));
var NuGetAssembly = Assembly.LoadFrom(Path.Combine(assemblyDirectory, "NuGet.Frameworks.dll"));
var NuGetFramework = NuGetAssembly.GetType("NuGet.Frameworks.NuGetFramework");
var NuGetFrameworkCompatibilityProvider = NuGetAssembly.GetType("NuGet.Frameworks.CompatibilityProvider");
var NuGetFrameworkDefaultCompatibilityProvider = NuGetAssembly.GetType("NuGet.Frameworks.DefaultCompatibilityProvider");
Expand Down
12 changes: 12 additions & 0 deletions src/Shared/MSBuildLoadContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,20 @@ internal class MSBuildLoadContext : AssemblyLoadContext
"MSBuild",
"Microsoft.Build",
"Microsoft.Build.Framework",
"Microsoft.Build.NuGetSdkResolver",
"Microsoft.Build.Tasks.Core",
"Microsoft.Build.Utilities.Core",
"NuGet.Build.Tasks",
"NuGet.Common",
"NuGet.Configuration",
"NuGet.Credentials",
"NuGet.DependencyResolver.Core",
"NuGet.Frameworks",
"NuGet.LibraryModel",
"NuGet.Packaging",
"NuGet.Protocol",
"NuGet.ProjectModel",
"NuGet.Versioning",
}.ToImmutableHashSet();

internal static readonly string[] Extensions = new[] { "ni.dll", "ni.exe", "dll", "exe" };
Expand Down

0 comments on commit bba8fa9

Please sign in to comment.