diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
index 1186b2c606f632..de5bc44f1ba793 100644
--- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
+++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
@@ -12,6 +12,7 @@
enable
true
true
+ true
true
true
$(MSBuildThisFileDirectory)ILLink\
@@ -856,7 +857,6 @@
-
@@ -1222,6 +1222,15 @@
Common\System\Threading\Tasks\TaskToApm.cs
+
+
+ Common\Interop\Interop.HostPolicy.cs
+
+
+
+
+
+
Common\Interop\Windows\Advapi32\Interop.ActivityControl.cs
@@ -1232,9 +1241,6 @@
Common\Interop\Windows\Advapi32\Interop.EVENT_INFO_CLASS.cs
-
- Common\Interop\Interop.HostPolicy.cs
-
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.PlatformNotSupported.cs
new file mode 100644
index 00000000000000..06df366a1c73df
--- /dev/null
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.PlatformNotSupported.cs
@@ -0,0 +1,31 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System.Reflection;
+using System.Runtime.Versioning;
+
+namespace System.Runtime.Loader
+{
+ [UnsupportedOSPlatform("android")]
+ [UnsupportedOSPlatform("browser")]
+ [UnsupportedOSPlatform("ios")]
+ [UnsupportedOSPlatform("maccatalyst")]
+ [UnsupportedOSPlatform("tvos")]
+ public sealed class AssemblyDependencyResolver
+ {
+ public AssemblyDependencyResolver(string componentAssemblyPath)
+ {
+ throw new PlatformNotSupportedException();
+ }
+
+ public string? ResolveAssemblyToPath(AssemblyName assemblyName)
+ {
+ throw new PlatformNotSupportedException();
+ }
+
+ public string? ResolveUnmanagedDllToPath(string unmanagedDllName)
+ {
+ throw new PlatformNotSupportedException();
+ }
+ }
+}
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.cs
index 644e536757b1b4..e2c1862767502b 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.cs
@@ -5,10 +5,16 @@
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
+using System.Runtime.Versioning;
using System.Text;
namespace System.Runtime.Loader
{
+ [UnsupportedOSPlatform("android")]
+ [UnsupportedOSPlatform("browser")]
+ [UnsupportedOSPlatform("ios")]
+ [UnsupportedOSPlatform("maccatalyst")]
+ [UnsupportedOSPlatform("tvos")]
public sealed class AssemblyDependencyResolver
{
///
diff --git a/src/libraries/System.Runtime.Loader/ref/System.Runtime.Loader.cs b/src/libraries/System.Runtime.Loader/ref/System.Runtime.Loader.cs
index e42a0642b32ea9..3aaa591f624114 100644
--- a/src/libraries/System.Runtime.Loader/ref/System.Runtime.Loader.cs
+++ b/src/libraries/System.Runtime.Loader/ref/System.Runtime.Loader.cs
@@ -22,6 +22,11 @@ public MetadataUpdateHandlerAttribute([System.Diagnostics.CodeAnalysis.Dynamical
}
namespace System.Runtime.Loader
{
+ [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")]
+ [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
+ [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
+ [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("maccatalyst")]
+ [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
public sealed partial class AssemblyDependencyResolver
{
public AssemblyDependencyResolver(string componentAssemblyPath) { }