[Post 4.0] Use AssemblyLoadContext in AssemblyContainer
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
Is your feature request related to a problem? Please describe.
Right now reloading assemblies is "fake" in that we do load a new version of the assembly, but we never unload the old version (we just forget about it and don't use it). For the most part this shouldn't be an issue (hasn't been so far) but if we can properly clean up the memory we should do it.
Describe the solution you'd like
AppDomains are no longer supported in newer frameworks and something we should look into is AssemblyLoadContext (available for .NET Core 3+), which allows to customize how dependencies of an assembly are loaded and allows proper unloading of all assemblies loaded with that context (see Unloadability).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating AssemblyContainer and its current assembly reloading path. Read the linked AssemblyLoadContext unloadability documentation, then determine the design needed to replace the existing behavior so old assemblies and their dependencies can be properly unloaded and memory reclaimed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100