Skip to content

Commit

Permalink
Mark AssemblyDependencyResolver as unsupported on Browser and mobile (d…
Browse files Browse the repository at this point in the history
…otnet#54601)

* Mark AssemblyDependencyResolver as unsupported on Browser and mobile

* Apply AlekseyK's workaround to fix android CI builds

* Add an annotation for maccatalyst
  • Loading branch information
MaximLipnin authored Jun 24, 2021
1 parent 4aeef0d commit 5306472
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<Nullable>enable</Nullable>
<IsOSXLike Condition="'$(TargetsOSX)' == 'true' or '$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'">true</IsOSXLike>
<IsiOSLike Condition="'$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'">true</IsiOSLike>
<IsMobileLike Condition="'$(TargetsBrowser)' == 'true' or '$(IsiOSLike)' == 'true' or '$(TargetsAndroid)' == 'true'">true</IsMobileLike>
<SupportsArmIntrinsics Condition="'$(Platform)' == 'arm64'">true</SupportsArmIntrinsics>
<SupportsX86Intrinsics Condition="'$(Platform)' == 'x64' or ('$(Platform)' == 'x86' and '$(TargetsUnix)' != 'true')">true</SupportsX86Intrinsics>
<ILLinkSharedDirectory>$(MSBuildThisFileDirectory)ILLink\</ILLinkSharedDirectory>
Expand Down Expand Up @@ -856,7 +857,6 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Intrinsics\Vector64_1.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Intrinsics\Vector64DebugView_1.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Intrinsics\X86\Enums.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Loader\AssemblyDependencyResolver.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Loader\AssemblyLoadContext.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Loader\LibraryNameVariation.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\MemoryFailPoint.cs" />
Expand Down Expand Up @@ -1222,6 +1222,15 @@
<Link>Common\System\Threading\Tasks\TaskToApm.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup Condition="'$(IsMobileLike)' != 'true'">
<Compile Include="$(CommonPath)Interop\Interop.HostPolicy.cs">
<Link>Common\Interop\Interop.HostPolicy.cs</Link>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Loader\AssemblyDependencyResolver.cs" />
</ItemGroup>
<ItemGroup Condition="'$(IsMobileLike)' == 'true'">
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Loader\AssemblyDependencyResolver.PlatformNotSupported.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.ActivityControl.cs">
<Link>Common\Interop\Windows\Advapi32\Interop.ActivityControl.cs</Link>
Expand All @@ -1232,9 +1241,6 @@
<Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.EVENT_INFO_CLASS.cs">
<Link>Common\Interop\Windows\Advapi32\Interop.EVENT_INFO_CLASS.cs</Link>
</Compile>
<Compile Include="$(CommonPath)Interop\Interop.HostPolicy.cs">
<Link>Common\Interop\Interop.HostPolicy.cs</Link>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\Tracing\ActivityTracker.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\Tracing\DiagnosticCounter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\Tracing\CounterGroup.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -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();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) { }
Expand Down

0 comments on commit 5306472

Please sign in to comment.