-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
As I discovered during my investigation of microsoft/MSBuildLocator#336, if an assembly is specified in TRUSTED_PLATFORM_ASSEMBLIES, the runtime does not allow loading a newer version of it, even in a separate ALC. This does make sense for assemblies in the shared framework, because not all of them are designed to be loaded multiple times, but TPA also includes user-specified dependencies, which caused the aforementioned issue, and can inhibit plugin dependency isolation.
Trying to load an assembly with an older or equal version will cause the runtime to ignore it and load the TPA assembly. However, contrary to what I would expect from the intent of this assembly unification, the same assembly will still be loaded once per ALC.
If this TPA assembly unification is desirable (which I believe it is), I believe that we should always load the TPA assemblies to the default ALC. I would also suggest to limit this behavior to assemblies in the shared framework (either in Microsoft.NetCore.App only, or in any of them). Regardless, we should update the managed assembly loading documentation, and make error messages more helpful.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status