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
I don't think this is Blazor specific, I believe it is likely an issue of serializing and deserializing tuples. I would suggest you replace the tuple with a proper type and see if you run into issues in that case.
changed the title [-]blazor wasm List<(string Key, string Value)> from server to client values lost[/-][+]System.Text.Json doesn't serialize tuples correctly[/+]on Jun 7, 2022
Setting milestone as 7.0.0 to consider fixing in this release or providing workable workaround although we cannot guarantee this will get fixed in this release.
Activity
javiercn commentedon Apr 20, 2022
@TDroogers thanks for contacting us.
I don't think this is Blazor specific, I believe it is likely an issue of serializing and deserializing tuples. I would suggest you replace the tuple with a proper type and see if you run into issues in that case.
TDroogers commentedon Apr 20, 2022
It works fine with
public List<KeyValuePair<string, string>> Claims { get; set; }javiercn commentedon Apr 20, 2022
@TDroogers that is then very likely because of the way the tuple is serialized.
I would suggest a couple of things.
This is very likely a dupe of #29045 and #876
javiercn commentedon Apr 20, 2022
@TDroogers let us know if you get it to work in a command-line app but still have issues with Blazor webassembly.
TDroogers commentedon Apr 20, 2022
Those looks indeed like the same issue, but on an eol .net version
It fails on the serialization side, it has indeed nothing to do with blazor.
xUnit test
javiercn commentedon Apr 20, 2022
@TDroogers I've transferred this issue to the runtime repo so that they can give you a definite answer here.
11 remaining items
[-]blazor wasm List<(string Key, string Value)> from server to client values lost[/-][+]System.Text.Json doesn't serialize tuples correctly[/+]krwq commentedon Jun 7, 2022
@TDroogers I went ahead and modified issue description to simplify it to the core of the issue
krwq commentedon Jun 7, 2022
Setting milestone as 7.0.0 to consider fixing in this release or providing workable workaround although we cannot guarantee this will get fixed in this release.
krwq commentedon Jun 7, 2022
Just found out this is by design since tuples don't have any public properties. The way you can do this is:
krwq commentedon Jun 7, 2022
I've created #70352 to track improvements in this area for vNext
TDroogers commentedon Jun 7, 2022
Thanks