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:
Jan Kotas authored and Andrew Schwartzmeyer committed 2016-05-24 09:55:04 -07:00
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;
}