You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UI test on Revit 2025 serializes a polymorphic record as an empty object #139
A RevitApiUiTest on Revit 2025 serializes a polymorphic record with the System.Text.Json package of the project.
On Revit 2025, a library that references the System.Text.Json of the runtime and a library with the System.Text.Json 10.0 package bind two copies of the assembly.
The polymorphism attributes of the first library are then types the serializer of the second library does not read.
Steps to reproduce
Declare an abstract record in a net8.0 library with no package reference to System.Text.Json:
Serialize a Warning[] with a source-generated JsonSerializerContext in a second library that references the System.Text.Json 10.0.x package and the first library.
Call it from a RevitApiUiTest in Revit 2025.
✔️ Expected Behavior
The array serializes as [{"kind":"overload","limit":1}], and the JSON deserializes back into the array.
❌ Actual Behavior
The array serializes as [{}], and its deserialization throws NotSupportedException: Deserialization of interface or abstract types is not supported.
Environment: Revit 2025.4, .NET 8.0.32, Nice3point.TUnit.Revit 2025.1.9. Revit 2027 on .NET 10 is not affected.
The cause is in the load context of Nice3point.Revit.Injector: https://github.com/Nice3point/RevitInjector/issues/105.
Activity