Rewrite bootstrapper logic to avoid relying on AppDomain #1392
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR rewrites several aspects of the bootstrapper executable to avoid depending on
AppDomain
. Instead, assembly metadata is inspected using MetadataLoadContext and isolated editor sessions are implemented using child processes spawned from the top-level executable.This is expected to improve both the cross-platform experience of the current editor, and facilitate the transition to .NET 6 where support for multiple
AppDomain
instances has been removed entirely. Other benefits include proper cleanup of loaded native dependencies (process tear-down will unload both native and managed dependencies) and also resolution of specific issues with drivers crashing when spawned from childAppDomain
(currently the workaround was to start these using the--no-boot
flag which should no longer be necessary).Fixes #1383