proto-cs is the heart of Dataflow Software package. It takes a Protocol Buffers definition file (.proto) and generates all the necessary C# based on definitions and options you provide.
The result can be a single C# file or a set of different files, depending on your options and the version of the compiler.
Note: proto-cs is a licensed tool and requires a valid license to be used.
protocs[.exe] filename.proto [filename.proto ...] [options] Options: -o [path]: output path for produced C# file(s) -i [path]: path for resolving import directives -s [path]: base path for source .proto files -min: produce minimal output, only Protocol Buffers support is generated -lic: makes compiler immediately fail if it's not registered -js: output JSON/JavaScript integration code -ashx: generates .ashx file for ASP.NET hosting
| Option | Description |
|---|---|
| -o path | This option allows you to specify the destination of the compiler output. By default, the files will be output to the current folder but in case your build process requires files to be generated in a specific folder you can use -o option to accomplish that. |
| -i path | Protocol Buffers allow you to import definitions from other .proto files into your file. By default, proto-cs will look in the current folder for those files but you can specify a path where those files are located. |
| -s path | By default, proto-cs will look for the source .proto files that you specify in the current folder. However you can specify an alternative path for your source .proto files if your build process requires it. |
| -min | Minimal output, only support for Protocol Buffers serializing and deserializing is generated |
| -lic | Makes compiler immediately fail if compiler is not registered |
| -js | This option instructs proto-cs to output a filename.js file that contains support for AJAX integration. Read more about this option here |
| -ashx | Compiler will output an .ashx file needed to terminate the requests when using ASP.NET to host the application |
| File | Description |
|---|---|
| filename.pb.cs | A C# file that contains all the code needed to serialize and deserialize messages defined in filename.proto. Based on the options can contain the code to support RPC, equal, clear, and some other features. |
| filename.ashx.cs (optional) |
A C# file that contains proxy classes for PBUF RPC needed for Web Services integration. |
| filename.ashx (optional) |
A .ashx file for the web services to terminate the incoming requests if ASP.NET is used |
| filename.js (optional) |
A JavaScript file with that defines JSON RPC interface for filename.proto. See this document for more information on AJAX integration. |