In a .NET Core 3.0 project, I've installed Google.Protobuf.Tools
,
<PackageReference Include="Google.Protobuf" Version="3.10.0" />
<PackageReference Include="Google.Protobuf.Tools" Version="3.10.0" />
The protoc
binary is where it is expected,
C:\Users\jdphe>dir %USERPROFILE%\.nuget\packages\google.protobuf.tools\3.10.0\tools\windows_x64
Volume in drive C has no label.
Volume Serial Number is 967E-3D8C
Directory of C:\Users\jdphe\.nuget\packages\google.protobuf.tools\3.10.0\tools\windows_x64
10/14/2019 07:36 PM <DIR> .
10/14/2019 07:36 PM <DIR> ..
10/02/2019 06:08 PM 3,611,120 protoc.exe
1 File(s) 3,611,120 bytes
2 Dir(s) 152,718,581,760 bytes free
However, when attempting to invoke protoc
with the <Generator>
tag in my csproj,
<None Update="Person.proto">
<Generator>$(NugetPackageRoot)google.protobuf.tools\3.10.0\tools\windows_x64\protoc.exe --csharp_out=Model Person.proto</Generator>
</None>
The generator 'C:\Users\jdphe.nuget\packages\google.protobuf.tools\3.10.0\tools\windows_x64\protoc.exe --csharp_out=Model Person.proto' was not found. Please verify the name.
I've verified that the command runs as expected from the project folder on the command line,
C:\Users\jdphe\source\repos\Phenix.Protobufconcat\Phenix.Protobufconcat> %USERPROFILE%.nuget\packages\google.protobuf.tools\3.10.0\tools\windows_x64\protoc.exe --csharp_out=Model Person.proto
I may not be understanding how the <Generator>
tag is supposed to work, but I'm not sure.