Skip to content

Using the Generator Backend

c80k edited this page May 6, 2020 · 2 revisions

Using the Generator Backend

The generator backend (capnp-csharp) is designed to be used in conjunction with the capnp tool (from the original Cap'n Proto tool suite). Technically it reads a Cap'n Proto-encoded code generation request from standard input and produces according C# files.

Deploy the VS capnp-csharp project to a standalone executable (refer to Microsoft instructions on how to deploy .NET Core applications) somewhere locally on your machine. From there have two options:

  • Either copy all files from the deployment target folder together with all files from the Cap'n Proto tool suite into a single location. This will provide you the most convenience because from now on you may invoke the tools like this:
capnp compile -ocsharp myschema.capnp
  • Alternatively, you may keep all executables at the locations where they currently are. Going with this option invoke them like this (path/to/capnp-csharp is the path to the executable inside your deployment target folder):
capnp compile -o"path/to/capnp-csharp" myschema.capnp