0

Until now, I was using protobuf-netGrpc to use gPRC to transmit data between service and client. It works, I can create an interface as contract between the service and the client and I can use classes that I can decorate the DTOs with attributes like DataContract and DataMemeber, that belongs to System.Runtime.Serialization, to serialize the classes.

But now I have a problem, I would like to serialize a DateOnly property, but protobuf-grpc is not compatible with this type.

Searching information, protobuf-net is compatible with this type, github project of protobuf-net.

In my project I don't have the protobuf-net package, I have only protobuf-net.Grpc and protobuf-net.Grpc.AspNetCore, so I am not using protobuf-net.

What is the difference between protobuf-net and protobuf-net.grpc? Could I use protobuf-net with protobuf-net.Grpc, to can use the code first solution and to have the benefits of protobuf-net? Because I have seen that that last update of protobuf-net.Grpc is in 2023-02-02 and it seems that protobuf-net is update more often, the last update is 2023-09-27.

Thanks so much.

3
  • 2
    Protobuf-net should be a dependency of protobuf-net.grpc. See the Dependencies tab. Note that Visual studio hides transitive dependencies in a subtree in the solution explorer. You could add a direct dependency if you want to use a later version of protobuf-net if you want, assuming there are no breaking changes. Commented Feb 6, 2024 at 15:50
  • that's true, under protobuf-net.Grpc, the protobuf-net is as depedency. However, the version that I have is the versión 2.4.8, but the last version is 3.2.30 according to the GitHub project. When I manage the nuget packages, I have all updated, so I am wondering if it would be possible to use the last version of protobuf-net with protobuf-net.Grpc. Commented Feb 6, 2024 at 15:55
  • 2
    If you just install the 3.2.30 package in nuget it should automatically add binding redirects etc to make it all work. But note that a new major version often indicate breaking changes. You may want to read the release notes, or just stick to the latest 2.* release. Commented Feb 6, 2024 at 16:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.