-
Navigate to the protobuf from GitHub
releases page
and download theprotoc-<VERSION>-win64.zip
for Windows, this includes a pre-built binary of the protoc tool, compiler etc. -
Extract it, place it in some folder like
C:\
and add the directoryC:\protoc-<VERSION>-win64\bin
to the path variable. -
Verify whether added properly to path variable or not by typing in command prompt -
protoc -help
-
Follow Google tutorial for Protobuf using C#.
-
Compile the .proto file to C# class
protoc -I. --csharp_out=. ./addressbook.proto "This generates Addressbook.cs in the solution folder".
-
To compile this code, we need to reference the
Google.Protobuf
assembly.PM > Install-Package Google.Protobuf
-
Add using directives to Program.cs for generated class form compiler (if namespace if different), and
Google.Protobuf
.
-
Notifications
You must be signed in to change notification settings - Fork 0
kunalm8470/Protobuf
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Playing with Protobufs with C#
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published