Skip to content

[jnimarshalmethod-gen] Avoid creating AppDomains #720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 18, 2020

Conversation

radekdoulik
Copy link
Member

This is part of making the tool to work on Windows and later also with
NET5. The created AppDomain was used to isolate processed assembly,
so that we can unload it and overwrite it with generated changes.

That didn't work on Windows even with .NET framework, which has
the AppDomains API. In NET5 the creation of AppDomains is not even
part of the API.

So instead of using the created AppDomains, we preload the assembly
in memory and load it from there.

This is part of making the tool to work on Windows and later also with
NET5. The created `AppDomain` was used to isolate processed assembly,
so that we can unload it and rewrite with generated changes.

That didn't work on Windows even with .NET framework, which has
the AppDomains API. In NET5 the creation of AppDomains is not even
part of the API.

So instead of using the created `AppDomain`'s, we preload the assembly
in memory and load it from there.
@jonpryor jonpryor merged commit 5a834d4 into dotnet:master Sep 18, 2020
@jpobst jpobst added this to the 11.1 (16.9 / 8.9) milestone Sep 22, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants