Skip to content

Commit 6d93a17

Browse files
committed
Add all classes to AssemblyLoadContext collection
To ensure that the initializer is called before any other code. This is as close to a global init hook as I can find.
1 parent b820817 commit 6d93a17

9 files changed

Lines changed: 9 additions & 0 deletions

test/csharp/test_Binders.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace PSTests
66
{
7+
[Collection("AssemblyLoadContext")]
78
public static class PSEnumerableBinderTests
89
{
910
[Fact]

test/csharp/test_CorePsExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace PSTests
66
{
7+
[Collection("AssemblyLoadContext")]
78
public static class CorePsExtensionsTests
89
{
910
[Fact]

test/csharp/test_CorePsPlatform.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace PSTests
88
{
9+
[Collection("AssemblyLoadContext")]
910
public static class PlatformTests
1011
{
1112
[Fact]

test/csharp/test_ExtensionMethods.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace PSTests
66
{
7+
[Collection("AssemblyLoadContext")]
78
public static class PSTypeExtensionsTests
89
{
910
[Fact]

test/csharp/test_FileSystemProvider.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace PSTests
77
{
8+
[Collection("AssemblyLoadContext")]
89
public static class FileSystemProviderTests
910
{
1011
[Fact]

test/csharp/test_MshSnapinInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace PSTests
66
{
77
// Not static because a test requires non-const variables
8+
[Collection("AssemblyLoadContext")]
89
public class MshSnapinInfoTests
910
{
1011
// Test that it does not throw an exception

test/csharp/test_PSVersionInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace PSTests
66
{
7+
[Collection("AssemblyLoadContext")]
78
public static class PSVersionInfoTests
89
{
910
[Fact]

test/csharp/test_SecuritySupport.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace PSTests
66
{
7+
[Collection("AssemblyLoadContext")]
78
public static class SecuritySupportTests
89
{
910
[Fact]

test/csharp/test_Utils.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace PSTests
66
{
7+
[Collection("AssemblyLoadContext")]
78
public static class UtilsTests
89
{
910
[Fact]

0 commit comments

Comments
 (0)