11 types derived from AssemblyLoadContext
Microsoft.Build (1)
Microsoft.CodeAnalysis (1)
Microsoft.CodeAnalysis.LanguageServer (1)
Microsoft.CodeAnalysis.Scripting (1)
Microsoft.CodeAnalysis.Test.Utilities (2)
MSBuild (1)
System.Private.CoreLib (3)
xunit.console (1)
1 instantiation of AssemblyLoadContext
System.Windows.Forms.Design.Tests (1)
204 references to AssemblyLoadContext
dotnet-svcutil-lib (1)
illink (1)
Microsoft.AspNetCore.Components.WebAssembly (2)
Microsoft.AspNetCore.Http.Extensions.Tests (1)
Microsoft.AspNetCore.Http.Microbenchmarks (1)
Microsoft.AspNetCore.Mvc.Core (5)
Microsoft.AspNetCore.Mvc.Core.Test (1)
Microsoft.Build (17)
Microsoft.Build.CommandLine.UnitTests (2)
Microsoft.CodeAnalysis (13)
Microsoft.CodeAnalysis.LanguageServer (14)
Services\ExtensionAssemblyManager.cs (13)
33private readonly ImmutableDictionary<string, AssemblyLoadContext> _directoryLoadContexts;
35private readonly ImmutableDictionary<string, AssemblyLoadContext> _assemblyFullNameToLoadContext;
39public ExtensionAssemblyManager(ImmutableDictionary<string, AssemblyLoadContext> directoryLoadContexts,
40ImmutableDictionary<string, AssemblyLoadContext> assemblyFullNameToLoadContext,
57var directoryLoadContexts = new Dictionary<string, AssemblyLoadContext>(StringComparer.Ordinal);
58var assemblyFullNameToLoadContext = new Dictionary<string, AssemblyLoadContext>(StringComparer.Ordinal);
101if (assemblyFullNameToLoadContext.TryGetValue(assemblyFullName, out var existingContext))
114if (!directoryLoadContexts.TryGetValue(directory, out var directoryContext))
123AssemblyLoadContext GetOrCreateDirectoryContext(string directory, string assemblyFilePath)
125if (directoryLoadContexts.TryGetValue(directory, out var directoryContext))
145AssemblyLoadContext.Default.Resolving += (context, assemblyName) =>
171if (_directoryLoadContexts.TryGetValue(directory, out var loadContext))
186if (_assemblyFullNameToLoadContext.TryGetValue(assemblyFullName, out var loadContext))
Microsoft.CodeAnalysis.LanguageServer.UnitTests (2)
Microsoft.DotNet.GenFacades (3)
MSBuild (16)
PresentationCore.Tests (1)
PresentationFramework.Fluent.Tests (1)
System.Printing.Tests (1)
System.Private.CoreLib (94)
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (38)
33private static Dictionary<long, WeakReference<AssemblyLoadContext>>? s_allContexts;
37private static Dictionary<long, WeakReference<AssemblyLoadContext>> AllContexts =>
39Interlocked.CompareExchange(ref s_allContexts, new Dictionary<long, WeakReference<AssemblyLoadContext>>(), null) ??
56private event Func<AssemblyLoadContext, AssemblyName, Assembly>? _resolving;
58private event Action<AssemblyLoadContext>? _unloading;
106Dictionary<long, WeakReference<AssemblyLoadContext>> allContexts = AllContexts;
110allContexts.Add(_id, new WeakReference<AssemblyLoadContext>(this, true));
159Dictionary<long, WeakReference<AssemblyLoadContext>> allContexts = AllContexts;
173AssemblyLoadContext? alc = GetLoadContext(a);
210public event Func<AssemblyLoadContext, AssemblyName, Assembly?>? Resolving
225public event Action<AssemblyLoadContext>? Unloading
264public static AssemblyLoadContext Default => DefaultAssemblyLoadContext.s_loadContext;
272public static IEnumerable<AssemblyLoadContext> All
278Dictionary<long, WeakReference<AssemblyLoadContext>>? allContexts = s_allContexts;
281WeakReference<AssemblyLoadContext>[] alcSnapshot;
285alcSnapshot = new WeakReference<AssemblyLoadContext>[allContexts.Count];
287foreach (KeyValuePair<long, WeakReference<AssemblyLoadContext>> item in allContexts)
293foreach (WeakReference<AssemblyLoadContext> weakAlc in alcSnapshot)
295if (weakAlc.TryGetTarget(out AssemblyLoadContext? alc))
472Dictionary<long, WeakReference<AssemblyLoadContext>>? allContexts = s_allContexts;
481foreach (KeyValuePair<long, WeakReference<AssemblyLoadContext>> alcAlive in allContexts)
483if (alcAlive.Value.TryGetTarget(out AssemblyLoadContext? alc))
499private static AsyncLocal<AssemblyLoadContext?>? s_asyncLocalCurrent;
519/// <see cref="AssemblyLoadContext.EnterContextualReflection"/>.
525public static AssemblyLoadContext? CurrentContextualReflectionContext => s_asyncLocalCurrent?.Value;
527private static void SetCurrentContextualReflectionContext(AssemblyLoadContext? value)
531Interlocked.CompareExchange<AsyncLocal<AssemblyLoadContext?>?>(ref s_asyncLocalCurrent, new AsyncLocal<AssemblyLoadContext?>(), null);
565AssemblyLoadContext assemblyLoadContext = GetLoadContext(activating) ??
576/// <see cref="AssemblyLoadContext.EnterContextualReflection"/>
581private readonly AssemblyLoadContext? _activated;
582private readonly AssemblyLoadContext? _predecessor;
585internal ContextualReflectionScope(AssemblyLoadContext? activating)
609AssemblyLoadContext context = (AssemblyLoadContext)(GCHandle.FromIntPtr(gchManagedAssemblyLoadContext).Target)!;
619foreach (Func<AssemblyLoadContext, AssemblyName, Assembly> handler in Delegate.EnumerateInvocationList(_resolving))
760AssemblyLoadContext parentALC = GetLoadContext(parentAssembly)!;
810internal static readonly AssemblyLoadContext s_loadContext = new DefaultAssemblyLoadContext();
System.Private.DataContractSerialization (4)
System.Private.Xml (13)
System.Reflection.DispatchProxy (5)
System.Runtime.Loader (1)
System.Windows.Forms.Design.Tests (2)
System.Xaml.Tests (1)
WindowsBase.Tests (1)
xunit.console (1)