Uh oh!
There was an error while loading. Please reload this page.
Support unloadability in DispatchProxy. - #62095
Conversation
And create them with AssemblyBuilderAccess.RunAndCollect.
f5d1489 to
62afbe1Compareteo-tsirpanis
commented
Nov 27, 2021
The two tests I added fail on Browser because |
jkotas
commented
Nov 27, 2021
I would recomend to early out from the tests if the Location is empty string. It will make the test pass in all situations when the assembly is not physically available on the disk (e.g. #43079). |
teo-tsirpanis
commented
Nov 27, 2021
Thanks for the feedback @jkotas, that was my first guess, thought there might be a more elegant way. I updated the tests. |
teo-tsirpanis
commented
Nov 30, 2021
Hello @d066hie, would you like to explain in more detail what to change in this PR? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Use a different name for the default ALC's proxy assembly and make it collectible only if its associated ALC is.
buyaa-n
commented
Dec 2, 2021
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
buyaa-n
left a comment
There was a problem hiding this comment.
Thank you @teo-tsirpanis, LGTM
buyaa-n
commented
Dec 3, 2021
Outerloop test failures are unrelated and reported as needed (#62305, #60753 (comment), #58616 (comment), #56165 (comment)). Thank you for your review @jkotas@vitek-karas if you have no more comments/concerns the PR is ready for merge. |
vitek-karas
commented
Dec 3, 2021
Thanks a lot @teo-tsirpanis !! |
The
System.Reflection.DispatchProxytype used to be incompatible with unloadability, because theAssemblyBuilderwith the generated proxy types is created withAssemblyBuilderAccess.Runand because all proxy types were associated with a single one.This PR creates a separate
AssemblyBuilder, one for eachAssemblyLoadContextof the base type's assembly, and passesAssemblyBuilderAccess.RunAndCollectto it (edit: only if the associated ALC is unloadable). It also cleans-up some code.Besides allowing unneeded proxy types to be granularly unloaded, it also added support for creating proxies for the same type in different ALC. I added tests for both cases.
Fixes#60468
Fixes#62050