Files
PowerShell-PowerShell/src/System.Management.Automation/CoreCLR/CorePsExtensions.cs
T
Dongbo Wang 8ae6c5bb3b Refactor PowerShell Core to use the default CoreCLR loader instead (#3903)
Remove the code that spins up our own assembly load context. Keep the code that registers our `Resolve` method to the default loader's `Resolving` event, so that we can continue to do special assembly resolution as needed (such as the GAC probing logic needed for consuming FullCLR PS modules).

Essentially, the assembly `Microsoft.PowerShell.CoreCLR.AssemblyLoadContext.dll` is not needed anymore, the remaining code should be moved to S.M.A.dll. However, that will break DSC and other native hosts that are hosting powershell. So this assembly is kept for now.
2017-06-05 20:59:30 -07:00

30 lines
920 B
C#

#if CORECLR
/********************************************************************++
Copyright (c) Microsoft Corporation. All rights reserved.
--********************************************************************/
namespace Microsoft.PowerShell.CoreCLR
{
using System;
using System.Reflection;
/// <summary>
/// AssemblyExtensions
/// </summary>
public static class AssemblyExtensions
{
/// <summary>
/// Load an assembly given its file path.
/// </summary>
/// <param name="assemblyPath">The path of the file that contains the manifest of the assembly.</param>
/// <returns>The loaded assembly.</returns>
[ObsoleteAttribute("This method is obsolete. Call Assembly.LoadFrom instead", false)]
public static Assembly LoadFrom(string assemblyPath)
{
return Assembly.LoadFrom(assemblyPath);
}
}
}
#endif