We've been using protobuf for a while at work and I decided to write a little console app for a client which would allow them to do some testing on site.
I started a new c# console app and downloaded google.protocolbuffers and protobuf-net from nuget.
What I'm trying to achieve is to turn my "messages.proto" file into "messages.cs"
I've tried to get the protobuf to build the messages file on a prebuild event but with no success, it seems the command arguments have changed since our first implementation. I followed the example here
http://code.google.com/p/protobuf-csharp-port/wiki/ProtoGen
And added the following pre build event
"$(projectdir)packages\Google.ProtocolBuffers.2.4.1.473\tools\protogen.exe" --proto_path=./protos protos/messages.proto --include_imports -output_directory=./
However I get the following error
Input file protos/messages.proto doesn't exist.
I've tried all sorts of combinations but nothing seems to work. Am I approaching this all wrong or is there a gotcha here? Any help much appreciated!
Have you tried using the absolute paths? I vaguely recall having a similar issue myself that turned out to be an issue with it not resolving relative paths correctly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With