Wrong context type displayed in "Context Holder" if some type is in more than one assembly

Issue #113 resolved
Trinidad Sibajas Bodoque created an issue

It may happen that a type in the context type popup of a "Context Holder" component may be in more than one assembly, and that can make the popup display the wrong type as the current one selected, or set the value to a different type than the one selected.

For example, in a project we have the "PlayFab Editor Extensions" plugin, which for some reason has the type Microsoft.Identity.Json.Linq.JObject in 2 different assemblies:

  • Microsoft.IdentityModel.Clients.ActiveDirectory (file "Assets\PlayFabEditorExtensions\Editor\Resources\Microsoft.IdentityModel.Clients.ActiveDirectory.dll")
  • Microsoft.Identity.Client (file "Assets\PlayFabEditorExtensions\Editor\Resources\Microsoft.Identity.Client.dll")

So the type appears with 2 AssemblyQualifiedName values:

  • Microsoft.Identity.Json.Linq.JObject, Microsoft.IdentityModel.Clients.ActiveDirectory, Version=5.2.9.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
  • Microsoft.Identity.Json.Linq.JObject, Microsoft.Identity.Client, Version=4.37.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae

But the type's FullName value is "Microsoft.Identity.Json.Linq.JObject" in both cases. This causes ContextTypeCache.ContextTypes to have 2 entries for that type, but ContextTypeCache.ContextTypePaths only has 1 ("Microsoft/Identity.Json.Linq/JObject"), and thus there's a mismatch between the entry in the popup menu and the actual selected type string saved for any types that appear in the menu after the Microsoft.Identity.Json.Linq.JObject one:

Menu item Type saved
None -
Microsoft/Identity.Json.Linq/JObject Microsoft.Identity.Json.Linq.JObject, Microsoft.IdentityModel.Clients.ActiveDirectory, Version=5.2.9.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
MyNamespace/MyType Microsoft.Identity.Json.Linq.JObject, Microsoft.Identity.Client, Version=4.37.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae ☹
OtherNamespace/OtherType MyNamespace.MyType ☹

(To avoid confusion in case you test with the PlayFab Editor Extensions plugin, note that there's also a Microsoft.IdentityModel.Json.Linq.JObject type that also appears in the context type popup, that's a different type to the one with the issue).

Comments (7)

  1. Christian Oeing repo owner

    @Trisibo Thanks a lot for your report, I will have a look at the issue. Shouldn’t be too hard to fix that

  2. Christian Oeing repo owner

    @Trinidad Sibajas Bodoque Could you sent me your DLLs with the Microsoft.Identity.Json.Linq.JObject types? I’d like to reproduce the issue to be sure that I fixed it.

  3. Log in to comment