Skip to content
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

[release/8.0-staging] Add runtime config parameter to force ijwhost to load assemblies in an isolated context #105436

Merged

Conversation

elinor-fung
Copy link
Member

@elinor-fung elinor-fung commented Jul 24, 2024

Backport of #105337 to release/8.0-staging

cc @mikeoliphant @AaronRobinsonMSFT

Customer Impact

  • Customer reported
  • Found internally

Issue: #104480

When trying to load a second copy of a C++/CLI assembly that has already been loaded from a different location, the runtime ends up in an infinite loop calling into the ijwhost stub for starting the runtime/loading the managed assembly. There is no workaround.

Regression

  • Yes
  • No

We made a change to make C++/CLI assemblies always load in the default ALC - this was based on common user feedback / pain points and made the behaviour better match .NET Framework (that migration being the major use case). However, this ends up breaking the reported scenario where multiple copies of a C++/CLI assembly (same assembly name in metadata) are loaded from different locations.

Testing

Customer validated (and implemented). Automated tests added.

Risk

Low. This adds a configuration option the change the load behaviour. It does not change the default behaviour.

mikeoliphant and others added 2 commits July 24, 2024 14:58
…n isolated context (dotnet#105337)

* Add support for isolated load context in LoadInMemoryAssemblyInContext by passing -1 as loadContext
* Have ijwhost check a runtime config parameter to determine if it should run in an isolated load context
* Added test for ijwhost isolated load context runtime config option
Copy link
Contributor

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. we will take for consideration in 8.0.x

@rbhanda rbhanda modified the milestones: 8.0.x, 8.0.9 Jul 25, 2024
@rbhanda rbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jul 25, 2024
@elinor-fung elinor-fung merged commit 2485745 into dotnet:release/8.0-staging Jul 29, 2024
177 of 181 checks passed
@elinor-fung elinor-fung deleted the ijwhost-isolated-switch-rel branch July 29, 2024 18:16
@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 2024
@rbhanda rbhanda modified the milestones: 8.0.9, 8.0.10 Oct 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Host Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants