Closed andrewleader closed 1 year ago
Yeah, I've seen such things before with other projects. I don't publish a UWP-specific target though, so I don't think there's much I can do in this library. Thanks for sharing a workaround though! 👍
FYI - the other place I saw this was https://github.com/getsentry/sentry-dotnet/issues/2029, and actually I believe it also may be due to STJ. Thanks!
After updating to 6.0.0 (I think it started with 6.0.0), I get the following exception when calling
TZNames.GetDisplayNames()
when my app is compiled with .NET Native (works fine in debug without .NET Native).This seems to be because TimeZoneNames is now using System.Text.Json, which seems to have problems with UWP .NET Native currently: https://github.com/dotnet/runtime/issues/978
Workaround
As described in https://github.com/dotnet/runtime/issues/978#issuecomment-567607904, in your UWP app's
Properties/Default.rd.xml
file, add the following namespace line for System.Text.Json.Serialization.ConvertersHope that helps some folks with the same issue! I think it could be possible for TimeZoneNames to include this declarative on behalf of System.Text.Json, but the right fix would be for Microsoft to fix that in the Json package itself. So I'm mostly posting this just as info for other users, feel free to close this if you'd like!