Zoom12 Posted May 4, 2020 Share Posted May 4, 2020 can someone help me and tell me why on earth the VS on this lines JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(new JsonSerializerSettings { Formatting = 1, ObjectCreationHandling = 2 }); gives me this errors error CS0266: Cannot implicitly convert type 'int' to 'Newtonsoft.Json.Formatting'. An explicit conversion exists (are you missing a cast?) error CS0266: Cannot implicitly convert type 'int' to 'Newtonsoft.Json.ObjectCreationHandling'. An explicit conversion exists (are you missing a cast?) how to repair this? Link to comment Share on other sites More sharing options...
CarlZalph Posted May 4, 2020 Share Posted May 4, 2020 28 minutes ago, Zoom12 said: can someone help me and tell me why on earth the VS on this lines JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(new JsonSerializerSettings { Formatting = 1, ObjectCreationHandling = 2 }); gives me this errors error CS0266: Cannot implicitly convert type 'int' to 'Newtonsoft.Json.Formatting'. An explicit conversion exists (are you missing a cast?) error CS0266: Cannot implicitly convert type 'int' to 'Newtonsoft.Json.ObjectCreationHandling'. An explicit conversion exists (are you missing a cast?) how to repair this? Typed language wants types. Formatting = Newtonsoft.Json.Formatting.Indented, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore As an example. Your ObjectCreationHandling will have its own type to look for. Link to comment Share on other sites More sharing options...
Zoom12 Posted May 5, 2020 Author Share Posted May 5, 2020 it is strange that some mods are compiled in such way... ok, i tried your thing and it works, thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.