mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Switch from AssemblyLoadContext.InitializeDefaultContext to AssemblyLoadContext.Resolving event
AssemblyLoadContext.InitializeDefaultContext was removed for .NET Core 1.0 RTM. Replaced its use with AssemblyLoadContext.Resolving event.
This commit is contained in:
1 parent
a02e89ee7b
commit
44ba0bb28f
2 files changed
+33
-39
No files matched your search
@@ -391,13 +391,7 @@ namespace System.Management.Automation
|
||||
{
|
||||
if (_psLoadContext == null)
|
||||
{
|
||||
_psLoadContext = AssemblyLoadContext.Default as PowerShellAssemblyLoadContext;
|
||||
if (_psLoadContext == null)
|
||||
{
|
||||
// The default load context may not be ours. This can happen during,
|
||||
// for instance, xUnit testing.
|
||||
_psLoadContext = new PowerShellAssemblyLoadContext(String.Empty);
|
||||
}
|
||||
_psLoadContext = PowerShellAssemblyLoadContext.Instance;
|
||||
}
|
||||
return _psLoadContext;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user