HowettNET GitLab GitHub

ProtoCTask is an MSBuild task that will invoke the protobuf compiler for any .proto files in your MSBuild-based project. It was originally developed for Visual Studio 2015 and has not received an update since then.

<PropertyGroup>
  <ProtoCTaskDir>path\to\directory\containing\ProtoC.props</ProtoCTaskDir>
</PropertyGroup>
<Import Project="$(ProtoCTaskDir)\ProtoC.props" />
<Import Project="$(ProtoCTaskDir)\ProtoC.targets" />

<!-- ... -->

<ItemGroup>
  <Protobuf Include="File.proto" />
</ItemGroup>

NOTE: If you build this from source, it currently requires bin/protoc.exe to be added to the staging directory manually.

  • Automatically generates .pb.cc files and passes them to ClCompile.
  • Adds the directory containing the .pb.h files to the ClCompile include path.
  • Does dependency tracking for minimal rebuilds.