Skip to content

AssemblyLoadContext does not provide proper isolation of types #41625

Open

Description

I am running into an issue where I am trying to port some logic which creates dynamic assemblies from framework to core. In this particular scenario the code that creates the dynamic assembly is in a nuget package that use CodeDomCompiler. The assembly is loaded from CompilerResult.CompiledAssembly which appears to always use the default context. This also happens with typeof comparisons inside of the library that is being dynamically loaded. What I'm seeing is that the AssemblyLoadContext seems to have some shortcomings in terms of control of how it can be used to isolate and unload dynamic code in libraries. The AppDomain concept supported these scenarios because all the types load in the domain where internally consistent. Is there any way to mimic the isolation of an AppDomain for libraries where a developer does not directly control the dynamic assembly load? If not is there any plans to perhaps support this in the future. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    area-AssemblyLoader-coreclrquestionAnswer questions and provide assistance, not an issue with source code or documentation.

    Type

    No type

    Projects

    • Status

      No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions