FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Dynamic resolver cache does not work with multiple instances of the same assembly in different load contexts · Issue #1952 · MessagePack-CSharp/MessagePack-CSharp · GitHub

Dynamic resolver cache does not work with multiple instances of the same assembly in different load contexts #1952

Description

Bug description

In Visual Studio extensibility host process, we have a model where process has a single instance of MessagePack assembly but each extension is hosted under a different AssemblyLoadContext. In cases where 2 extensions have the same assembly with message pack compatible types, and process has 2 instances of the assembly load under different contexts the dynamic resolver will fail to work due to type equivalence issues.

Per our chat with @AArnott, this is happening because there is a single instance of DynamicUnionResolver assembly in the context of MessagePack assembly and a limitation is that an assembly in .net can't have a reference to 2 instances of the same assembly name. So we need to consider having a different DynamicUnionResolver assembly per load context (and similarly for other dynamic resolver assemblies too).

Repro steps

  • Create an assembly with a message pack object that has union attribute.

  • Load message pack in a .net core app in the default load context.

  • Load the test assembly twice under different load contexts and try to serialize an instance of the object.

  • Runtime: (e.g. .NET Framework, .NET Core, Unity, mono, etc.) .Net Core

Additional context

Add any other context about the problem here.

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL