WinFormsComInterop icon indicating copy to clipboard operation
WinFormsComInterop copied to clipboard

Can WinFormsComInterop work with json

Open duykhongphai opened this issue 2 years ago • 1 comments

I created a winform to upload files to gg drive and got the error "Newtonsoft.Json.JsonSerializationException: Unable to find a constructor to use for type Google.Apis.Auth.OAuth2.GoogleClientSecrets. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path "installed', line 2, position 16. at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewO bject(JsonReader, JsonObjectContract, JsonProperty, JsonProperty, String, Boolean&)+0x18f at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader, Type, JsonContract, JsonProperty, JsonContainerContract, JsonProperty, Object) + 0x2a4 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValuel nternal(JsonReader, Type, JsonContract, JsonProperty, JsonContainerContract, JsonProperty, Object) + 0xa4 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(Js onReader, Type, Boolean)+0x257 at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader, Type) + Oxf4 at Google.Apis.Json.NewtonsoftJsonSerializer.DeserializeT 0x92" when building to native code but when running directly on visual studio it's okay! Please help me

duykhongphai avatar Oct 07 '23 09:10 duykhongphai

This project only helps WinForms controls to play nicely with NativeAOT. All other dependencies should be handled separately. I would suggest raising issue at Google API library https://github.com/googleapis/google-api-dotnet-client/issues

kant2002 avatar Oct 07 '23 09:10 kant2002