diff --git a/src/libraries/System.Reflection.TypeExtensions/tests/ModuleTests.cs b/src/libraries/System.Reflection.TypeExtensions/tests/ModuleTests.cs index 4e9233de36a73e..4430c629ccd46b 100644 --- a/src/libraries/System.Reflection.TypeExtensions/tests/ModuleTests.cs +++ b/src/libraries/System.Reflection.TypeExtensions/tests/ModuleTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.IO; using Xunit; namespace System.Reflection.Tests @@ -22,11 +23,10 @@ public void GetModuleVersionId_HasModuleVersionId_BehaveConsistently() } } - // This calls Assembly.Load, but xUnit turn is into a LoadFrom because TinyAssembly is just a Content item in the project. [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))] public void GetModuleVersionId_KnownAssembly_ReturnsExpected() { - Module module = Assembly.Load(new AssemblyName("TinyAssembly")).ManifestModule; + Module module = Assembly.LoadFrom(Path.Combine(AppContext.BaseDirectory, "TinyAssembly.dll")).ManifestModule; Assert.True(module.HasModuleVersionId()); if (!(PlatformDetection.IsMonoRuntime && PlatformDetection.IsAppleMobile && PlatformDetection.IsBuiltWithAggressiveTrimming)) { diff --git a/src/libraries/System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj b/src/libraries/System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj index c62b81f0f28d2f..9909ec4f738030 100644 --- a/src/libraries/System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj +++ b/src/libraries/System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj @@ -129,4 +129,13 @@ + + + + + + diff --git a/src/libraries/System.Runtime/tests/System.Reflection.Tests/AssemblyTests.cs b/src/libraries/System.Runtime/tests/System.Reflection.Tests/AssemblyTests.cs index 5e5f972a238370..8bef5a6a799bb3 100644 --- a/src/libraries/System.Runtime/tests/System.Reflection.Tests/AssemblyTests.cs +++ b/src/libraries/System.Runtime/tests/System.Reflection.Tests/AssemblyTests.cs @@ -154,7 +154,7 @@ public void GetEntryAssembly() string assembly = Assembly.GetEntryAssembly().ToString(); bool correct; - if (PlatformDetection.IsNativeAot) + if (PlatformDetection.IsNativeAot || PlatformDetection.IsReadyToRunCompiled) { // The single file test runner is not 'xunit.console'. correct = assembly.IndexOf("System.Reflection.Tests", StringComparison.OrdinalIgnoreCase) != -1; diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 4d543e9028294d..e38746e4f7a561 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -655,19 +655,8 @@ - - - - - +