From 473ac416308537582ab622a379bb013b7910d7a4 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Tue, 16 Feb 2016 14:18:44 -0800 Subject: [PATCH] Initialize the ALC for the runspace tests This initialization was moved out of the native host and into the managed host, so the same setup must now be done before tests. --- test/csharp/test_Runspace.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/csharp/test_Runspace.cs b/test/csharp/test_Runspace.cs index 70335af0f..398c92472 100644 --- a/test/csharp/test_Runspace.cs +++ b/test/csharp/test_Runspace.cs @@ -13,6 +13,12 @@ namespace PSTests private static int count = 3; private static string script = String.Format($"get-process | select-object -first {count}"); + // Initialize the Core PowerShell AssemblyLoadContext + public RunspaceTests() + { + PowerShellAssemblyLoadContextInitializer.SetPowerShellAssemblyLoadContext(AppContext.BaseDirectory); + } + [Fact] public void TestRunspaceWithPipeline() {