ProtoCTask
DHowett/ProtoCTask (HowettNET GitLab)
DHowett/ProtoCTask
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 toClCompile
. - Adds the directory containing the
.pb.h
files to theClCompile
include path. - Does dependency tracking for minimal rebuilds.