AssemblyLoadContext: Consider adding AssemblyLoadContext.Current API #7642
Labels
area-AssemblyLoader-coreclr
enhancement
Product code improvement that does NOT require public API changes/additions
Milestone
Right now the
AssemblyLoadContext
class exposes aDefault
static property that returns the default load context (AppPathAssemblyLoadContext). Consider adding anAssemblyLoadContext.Current
static property that returns the currentAssemblyLoadContext
from which the calling type's assembly is resolved. Here are some data points to support this API.AssemblyLoadContext.Default
to load assemblies instead of using the current ALC, as AssemblyLoadContext.Default is discoverable and the developer may not know the implications of loading into default vs. current ALC. A developer may not be even aware of 'current ALC' as a concept.AssemblyLoadContext.Current
API with appropriate documentation, it would be clearer to the library developer and possibly force to think about using default or current ALC as per their use case and intended behavior.As an example, here is an issue in MVC due to use of incorrect ALC for loading - aspnet/Mvc#5960 .
The text was updated successfully, but these errors were encountered: