Skip to content

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

Description

@po0p

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 😃

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions