none
Use CSharp Protobuf ParseFrom(Stream),But Show Wire Type is Invalid,Could Someone Tell me Where am I wrong?Thanks a lot RRS feed

  • Question

  • Below is the code :

    FileStream stream = new FileStream("D:\\share_jcy\\ProtoBuf\\demo.proto", FileMode.Open);
    CodedInputStream inStream = new CodedInputStream(stream);
    TestDeprecatedFields f = TestDeprecatedFields.Parser.ParseFrom(stream);

    TestDeprecatedFields was the class I compiled from the proto file with protoc.I run these code,but it comes System.InvalidOperationException:“Wire Type is invalid.”

    Could Someone Tell me How can I Parse the proto file?Thanks a lot.

    Saturday, February 23, 2019 10:20 AM

All replies

  • Below is the code :

    FileStream stream = new FileStream("D:\\share_jcy\\ProtoBuf\\demo.proto", FileMode.Open);
    CodedInputStream inStream = new CodedInputStream(stream);
    TestDeprecatedFields f = TestDeprecatedFields.Parser.ParseFrom(stream);

    TestDeprecatedFields was the class I compiled from the proto file with protoc.I run these code,but it comes System.InvalidOperationException:“Wire Type is invalid.”

    Could Someone Tell me How can I Parse the proto file?Thanks a lot.


    Hi   ChunyuJiao, 

    As far as I know, Protobuf is an open source(protobuf) serialization framework provided by Google, similar to XML, JSON, and data representation language.

    I suggest you can go to theprotobuf support center for getting suitable help.

    Thank you for your understanding.

    Best Regards,

    Yong Lu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 25, 2019 8:42 AM
    Moderator