mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
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.
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Management.Automation.Language;
|
||||
|
||||
namespace PSTests
|
||||
{
|
||||
[Collection("AssemblyLoadContext")]
|
||||
public static class PSEnumerableBinderTests
|
||||
{
|
||||
[Fact]
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Management.Automation;
|
||||
|
||||
namespace PSTests
|
||||
{
|
||||
[Collection("AssemblyLoadContext")]
|
||||
public static class CorePsExtensionsTests
|
||||
{
|
||||
[Fact]
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Management.Automation;
|
||||
|
||||
namespace PSTests
|
||||
{
|
||||
[Collection("AssemblyLoadContext")]
|
||||
public static class PlatformTests
|
||||
{
|
||||
[Fact]
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Management.Automation;
|
||||
|
||||
namespace PSTests
|
||||
{
|
||||
[Collection("AssemblyLoadContext")]
|
||||
public static class PSTypeExtensionsTests
|
||||
{
|
||||
[Fact]
|
||||
|
||||
@@ -5,6 +5,7 @@ using Microsoft.PowerShell.Commands;
|
||||
|
||||
namespace PSTests
|
||||
{
|
||||
[Collection("AssemblyLoadContext")]
|
||||
public static class FileSystemProviderTests
|
||||
{
|
||||
[Fact]
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Management.Automation;
|
||||
namespace PSTests
|
||||
{
|
||||
// Not static because a test requires non-const variables
|
||||
[Collection("AssemblyLoadContext")]
|
||||
public class MshSnapinInfoTests
|
||||
{
|
||||
// Test that it does not throw an exception
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Management.Automation;
|
||||
|
||||
namespace PSTests
|
||||
{
|
||||
[Collection("AssemblyLoadContext")]
|
||||
public static class PSVersionInfoTests
|
||||
{
|
||||
[Fact]
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Management.Automation;
|
||||
|
||||
namespace PSTests
|
||||
{
|
||||
[Collection("AssemblyLoadContext")]
|
||||
public static class SecuritySupportTests
|
||||
{
|
||||
[Fact]
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Management.Automation;
|
||||
|
||||
namespace PSTests
|
||||
{
|
||||
[Collection("AssemblyLoadContext")]
|
||||
public static class UtilsTests
|
||||
{
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user