Monday 15 August 2011

c# - Confused about protobuf-net WCF usage -


I am following the following to add protobuf-net to my WCF project. I have a shared DTO library, both servers and clients use those DTO classes. I have attributed all my service methods with the [OperationContact] attributes, but I have not assigned the [DataContract] attributes to my DTO classes. Added

I protobuf-net Nuget package and added the configuration to web.config .

I am using IIS Express to test my service, and thought that I should be fine with what I had so far. However, after testing some calls, I noticed that I forgot to add protobuf-net to my client and so far everything worked as expected (i.e. no error with serialization or deserialization No).

I suspect that the use of protobf has not happened at all in my program, and I am missing something. But I can live with adding them, if so, then protobuf-net needs to be done.

What else am I missing? A year ago, I had to face the same problem, where ProtoBu is an excellent option with WCF.

I have created an open source project to overcome these shortcomings, it uses Prototu-Net Library and adds functionality for it, thus you can now share more assemblies with the client do not require. However, again you need to enter the Data Contract properties though at this time.

You can give it a try:

Disclaimer: I am the creator and owner of the above project.


No comments:

Post a Comment