runtime: System.Text.Json throw exceptions on UWP in Release Build

Use System.Json.Text in UWP,

JsonSerializer.ToString(new { test = "abc" });
Failure occurred while loading a type.

This operation cannot be carried out because metadata for the following object was removed for performance reasons: <unavailable>
No further information is available. Rebuild in debug mode for better information.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 4
  • Comments: 15 (9 by maintainers)

Most upvoted comments

I added this to rd.xml, seems to work.

<Namespace Name="System.Text.Json.Serialization.Converters" Browse="Required All"/>

Here’s the issue I’ve been using to track this getting resolved. The current design question is around PreserveDependencyAttribute and whether it will be renamed/reused etc. In the mean time we’ll need to have rd.xml workarounds.

FYI @MattWhilden

Relinking to our Windows Community Toolkit Issue here as well.

@ViktorHofer can you clarify the resolution on all these issues that are getting closed?