From e6e170fdec2bb20a76126bd9b40e4a284e6c92f2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Strehovsk=C3=BD?= Date: Mon, 1 Jul 2019 07:15:28 +0200 Subject: [PATCH] Use AssemblyLoadContext from shared partition (dotnet/corert#7570) We were missing methods that got added for 3.0. The only LoadContext that works is the default one though. Signed-off-by: dotnet-bot --- .../shared/System.Private.CoreLib.Shared.projitems | 2 +- .../shared/System/Runtime/Loader/AssemblyLoadContext.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems index 0e914fc..049a914 100644 --- a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems +++ b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems @@ -707,7 +707,7 @@ - + diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.cs b/src/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.cs index 230667b..1210987 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/Loader/AssemblyLoadContext.cs @@ -275,6 +275,7 @@ namespace System.Runtime.Loader return null; } +#if !CORERT [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public Assembly LoadFromAssemblyName(AssemblyName assemblyName) { @@ -285,6 +286,7 @@ namespace System.Runtime.Loader StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; return Assembly.Load(assemblyName, ref stackMark, this); } +#endif // These methods load assemblies into the current AssemblyLoadContext // They may be used in the implementation of an AssemblyLoadContext derivation -- 2.7.4