Closed Enngage closed 1 year ago
Maybe this is related to https://github.com/aspnet/Announcements/issues/494 which should be fixed in rc-2
I have to admit that I haven't beta tested NET7. Give me some time to review the links you have provided and run the test under NET7.
By the way, do you have a code,sample to help me reproduce the problem?
Thanks for a quick response!
The code I tested is pretty simple:
var connectionInfo = new JwtConnectionInfo(config.ApiKey, config.ApiSecret);
var client = new ZoomClient(connectionInfo);
await zoomClient.Meetings.CreateScheduledMeetingAsync(
zoomTrainer.Email,
appointment.DisplayName,
appointment.Notes,
appointment.StartDate,
appointment.AppointmentLength,
TimeZones.UTC
);
This fails with the exception above. This didn't happen on .NET 6. I've migrated straight to rc-1 so I'm not sure if previous versions worked well, but given the accouncement (https://github.com/aspnet/Announcements/issues/494) I would think that this might very well get fixed in rc-2 by the .NET team.
I am only starting my investigation but I thought I would share my thoughts and findings so far:
I think the root of the problem you are highlighting is that the .NET team made a breaking change in System.Text.Json in .NET7: they are no longer falling back to reflection based serialization when a type is not explicitly specified in the serialization context. It so happens that all model classes are specified in ZoomNet's custom serialization context BUT (and this is important) none of the enum
types are listed (such as TimeZones
for example, which is the type in the exception you reported).
I haven't tested this yet but I'm pretty sure this problem will go away if I explicitly specify all the enum
types in the context.
I finally have my workstation configured with .NET7 and I am able to reproduce the problem simply by running the unit tests and the integration tests. In fact, what I am observing is even worse than I originally imagined: it's not just the enum
that I need to add to the serialization context but also for every specified type, I also need to specify "array of T", "nullable of T", etc.
For example, despite the fact that Recording, ChatChannelMember, MeetingSummary and PhoneNumber are specified in our custom serialization context, I am getting the following exceptions:
Metadata for type 'ZoomNet.Models.Recording[]' was not provided by TypeInfoResolver of type 'ZoomNet.Json.ZoomNetJsonSerializerContext'.
Metadata for type 'ZoomNet.Models.ChatChannelMember[]' was not provided by TypeInfoResolver of type 'ZoomNet.Json.ZoomNetJsonSerializerContext'.
Metadata for type 'ZoomNet.Models.MeetingSummary[]' was not provided by TypeInfoResolver of type 'ZoomNet.Json.ZoomNetJsonSerializerContext'.
Metadata for type 'System.Collections.Generic.IEnumerable`1[ZoomNet.Models.PhoneNumber]' was not provided by TypeInfoResolver of type 'ZoomNet.Json.ZoomNetJsonSerializerContext'.
I tried the TypeInfoResolver = JsonTypeInfoResolver.Combine(ZoomNetJsonSerializerContext.Default, new DefaultJsonTypeInfoResolver())
workaround suggested in one of the articles you linked but it had no effect at all.
I published a beta package on my MyGet feed for .NET7
I think it should solve all the Metadata for type 'foo' was not provided
but let me know if you find that I missed anything.
Thanks so much @Jericho ! I've installed 0.51.0-net7-0006
and it works great! Thanks again for such a quick response and resolution :-)
Thanks for confirming. I'll work on merging the changes into the main branch so it gets included in the next release.
:tada: This issue has been resolved in version 0.51.1 :tada:
The release is available on:
Your GitReleaseManager bot :package::rocket:
Hey guys,
Using the
.NET 7.0.0-rc.1
we get the following exception:Exception:
This seems to be related to https://github.com/dotnet/aspnetcore/issues/43236 and a potential workaround is also mentioned at https://github.com/dotnet/runtime/issues/71714
Would be great if you could release a preview with this fix as it's currently preventing users from using ZoomNet in .NET 7 :-)