Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[One .NET] Enable support for AssemblyLoadContext (#5940)
Context: https://docs.microsoft.com/dotnet/api/system.runtime.loader.assemblyloadcontext?view=net-5.0 .NET Core -- and thus, .NET 5+ -- removed most support for `System.AppDomain` -- technically, there still exists a single `AppDomain`, but creation of new ones is no longer possible -- with [`System.Runtime.Loader.AssemblyLoadContext`][0] acting as the replacement for *some* previous `AppDomain` functionality. TL;DR: `AssemblyLoadContext` allows (potentially) loading and unloading assemblies, but *doesn't* allow creating an in-process "sandbox" like `AppDomain` originally did. ([Code Access Security][1] was deprecated by .NET Framework 4 and [isn't present in .NET 5][2]; `AppDomain` for sandboxing purposes was, in retrospect, rarely a good idea.) Commit 0cd890b introduced partial support for using `AssemblyLoadContext`, but it was necessarily incomplete until after [dotnet/runtime#53308][3] and other fixes landed. Add support for calling the new `AssemblyLoadContext`-oriented MonoVM functions to load an assembly into either the default `AssemblyLoadContext` (early in the startup process) or into the application-created context later on during application run time. MonoVM also adds new preload hooks which work with the `AssemblyLoadContext` instead of the older AppDomains. [0]: https://docs.microsoft.com/dotnet/api/system.runtime.loader.assemblyloadcontext?view=net-5.0 [1]: https://docs.microsoft.com/previous-versions/dotnet/framework/code-access-security/code-access-security [2]: https://docs.microsoft.com/dotnet/core/compatibility/core-libraries/5.0/code-access-security-apis-obsolete#reason-for-change [3]: dotnet/runtime#53308
- Loading branch information
Showing
6 changed files
with
183 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.