diff --git a/src/libraries/System.Runtime.Loader/tests/DefaultContext/DefaultLoadContextTest.cs b/src/libraries/System.Runtime.Loader/tests/DefaultContext/DefaultLoadContextTest.cs index ab0814f4e1e7be..4d506e46437f65 100644 --- a/src/libraries/System.Runtime.Loader/tests/DefaultContext/DefaultLoadContextTest.cs +++ b/src/libraries/System.Runtime.Loader/tests/DefaultContext/DefaultLoadContextTest.cs @@ -86,6 +86,7 @@ private Assembly ResolveNullAssembly(AssemblyLoadContext sender, AssemblyName as // Does not apply to Mono AOT scenarios as it is expected the name of the .aotdata file matches // the true name of the assembly and not the physical file name. [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT), nameof(PlatformDetection.HasAssemblyFiles))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public void LoadInDefaultContext() { // This will attempt to load an assembly, by path, in the Default Load context via the Resolving event diff --git a/src/libraries/System.Runtime.Loader/tests/DefaultContext/System.Runtime.Loader.DefaultContext.Tests.csproj b/src/libraries/System.Runtime.Loader/tests/DefaultContext/System.Runtime.Loader.DefaultContext.Tests.csproj index 39ecb948c19636..3b55c05d9f9e3b 100644 --- a/src/libraries/System.Runtime.Loader/tests/DefaultContext/System.Runtime.Loader.DefaultContext.Tests.csproj +++ b/src/libraries/System.Runtime.Loader/tests/DefaultContext/System.Runtime.Loader.DefaultContext.Tests.csproj @@ -15,4 +15,10 @@ CopyToOutputDirectory="PreserveNewest" TargetPath="System.Runtime.Loader.Noop.Assembly_test.dll" /> + + + + + + diff --git a/src/libraries/System.Runtime.Loader/tests/ILLink.Descriptors.xml b/src/libraries/System.Runtime.Loader/tests/ILLink.Descriptors.xml index 7fa0c9a0982542..991945c09a3ad2 100644 --- a/src/libraries/System.Runtime.Loader/tests/ILLink.Descriptors.xml +++ b/src/libraries/System.Runtime.Loader/tests/ILLink.Descriptors.xml @@ -2,4 +2,6 @@ + + diff --git a/src/libraries/System.Runtime.Loader/tests/RefEmitLoadContext/System.Runtime.Loader.RefEmitLoadContext.Tests.csproj b/src/libraries/System.Runtime.Loader/tests/RefEmitLoadContext/System.Runtime.Loader.RefEmitLoadContext.Tests.csproj index 8be7fcae782447..f203c97e099cf6 100644 --- a/src/libraries/System.Runtime.Loader/tests/RefEmitLoadContext/System.Runtime.Loader.RefEmitLoadContext.Tests.csproj +++ b/src/libraries/System.Runtime.Loader/tests/RefEmitLoadContext/System.Runtime.Loader.RefEmitLoadContext.Tests.csproj @@ -14,4 +14,10 @@ OutputItemType="content" CopyToOutputDirectory="PreserveNewest" /> - \ No newline at end of file + + + + + + + diff --git a/src/libraries/System.Runtime.Loader/tests/ResourceAssemblyLoadContext.cs b/src/libraries/System.Runtime.Loader/tests/ResourceAssemblyLoadContext.cs index 84ad66d3433455..8b95fb944e6338 100644 --- a/src/libraries/System.Runtime.Loader/tests/ResourceAssemblyLoadContext.cs +++ b/src/libraries/System.Runtime.Loader/tests/ResourceAssemblyLoadContext.cs @@ -31,6 +31,28 @@ protected override Assembly Load(AssemblyName assemblyName) if (asmStream == null) { + // On platforms where assemblies are deployed as files alongside the app + // (e.g., Apple mobile CoreCLR) rather than embedded resources, fall back + // to loading from the app directory. + string basePath = Path.Combine(AppContext.BaseDirectory, assembly); + if (File.Exists(basePath)) + { + if (LoadBy == LoadBy.Path) + { + var tempPath = Directory.CreateTempSubdirectory().FullName; + string path = Path.Combine(tempPath, assembly); + File.Copy(basePath, path); + return LoadFromAssemblyPath(path); + } + else if (LoadBy == LoadBy.Stream) + { + using (FileStream stream = File.OpenRead(basePath)) + { + return LoadFromStream(stream); + } + } + } + return null; } diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index d6c4aed495b680..f60a31ed6ac57a 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -656,7 +656,6 @@ -