Casting Error, Not sure why. Newtonsoft.Json;
Tried a bunch of things to fix it, but I'm honestly stumped. I'll also paste in the Deserialize method.
17 Replies
Appricate any help. I'll try not to be too needy lol
What's the error, exactly?
error CS0266: Cannot implicitly convert type 'object' to 'Cereal.Person'
ing a cast?)
Person np = Serializer.Deserialize<Person>("test.json");
On that line
(also, why Newtonsoft instead of the built-in
Systen.Text.Json
...?)uhh
didnt know it existed
Is it better?
Faster
And built-in, so no need for any dependencies
Does it serialize for me or do I have to set that up?
It works like Newtonsoft
alrighty, ig ill do that one instead. Though i dont think this is a Newtonsoft issue
Yeah, it's most probably not
I think im doin something wrong with my method or my generics idk
Your code should work, from what I can see
That cast to
T
is unnecessary
But shouldn't be causing any issuesyeah, i did that to try and fix it lol
oh bruh
i restarted vscode and it disappeared
lmao
alrighty well
VS Code moment
thanks for the help loll
ig ill also try system json