0
Von sample.proto
ProtoGen.exe aktivieren Service Generation
package Busy.Proto;
option optimize_for = SPEED;
message BusyRequest { required string message = 1;}
message BusyResponse {required string message = 1;}
service BusyService {rpc Send (BusyRequest) returns (BusyResponse);}
Erzeugung .cs
Datei über folgenden Befehl ein, in Paket-Manager-Konsole
ProtoGen.exe sample.proto -output_directory="C:\SomeDir"
Resultierende sample.cs
Datei
// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT!
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.ProtocolBuffers;
...
#region Services
/*
* Service generation is now disabled by default, use the following option to enable:
* option (google.protobuf.csharp_file_options).service_generator_type = GENERIC;
*/
#endregion
...
Versuchte
012.351.- ausführen
ProtoGen.exe sample.proto -output_directory="C:\SomeDir" option (google.protobuf.csharp_file_options).service_generator_type = GENERIC;
in Package Manager-Konsole. Endet mit Fehler
Der Begriff 'google.protobuf.csharp_file_options' wird nicht als Name erkannt ..
- hinzufügen
option service_generator_type = GENERIC;
insample.proto
. Endet mit Fehler
nicht Symbol
lösen Wie Services
Generation ermöglichen?