PipeMethodCalls icon indicating copy to clipboard operation
PipeMethodCalls copied to clipboard

Struct/Class fields will get (de)serialized incorrectly with PipeMethodCalls.NetJson

Open po0p opened this issue 1 year ago • 0 comments

Hi. First of all, thanks for awesome work. Upgrading some netfw wcf legacy to .net8 has been a pain, your library is a lifesaver. Also, my ipc is between x64 and x86 and everything seems to work flawlessly. Now, the issue: Consider having this struct as an argument/subtype of argument/return value of the interface method:

struct Vector2
{
   int x; 
   int y;
}

This will get (de)serialized to {0,0} because IncludeFields is false by default in default JsonSerializerOptions. I have been using newtonsoft.json for serialization before and it was working with structs out of the box, so this is unexpected, although maybe not a bug. I am considering trying out MessagePack now, maybe it will indeed be a lot faster than json 😃

po0p avatar Dec 15 '24 19:12 po0p