diff --git a/examples/csharp/Helloworld/Greeter/Greeter.csproj b/examples/csharp/Helloworld/Greeter/Greeter.csproj index 3d4be5da6b4..1ca821320cd 100644 --- a/examples/csharp/Helloworld/Greeter/Greeter.csproj +++ b/examples/csharp/Helloworld/Greeter/Greeter.csproj @@ -9,10 +9,10 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="Google.Protobuf" Version="3.5.0" /> - <PackageReference Include="Google.Protobuf.Tools" Version="3.5.0" /> - <PackageReference Include="Grpc" Version="1.13.1" /> - <PackageReference Include="Grpc.Tools" Version="1.13.1" /> + <PackageReference Include="Google.Protobuf" Version="3.6.1" /> + <PackageReference Include="Google.Protobuf.Tools" Version="3.6.1" /> + <PackageReference Include="Grpc" Version="1.14.1" /> + <PackageReference Include="Grpc.Tools" Version="1.14.1" /> </ItemGroup> </Project> diff --git a/examples/csharp/Helloworld/Greeter/Helloworld.cs b/examples/csharp/Helloworld/Greeter/Helloworld.cs index ecfc8e131cb..e008ec27e54 100644 --- a/examples/csharp/Helloworld/Greeter/Helloworld.cs +++ b/examples/csharp/Helloworld/Greeter/Helloworld.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: helloworld.proto +// <auto-generated> +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: helloworld.proto +// </auto-generated> #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -44,6 +46,7 @@ namespace Helloworld { /// </summary> public sealed partial class HelloRequest : pb::IMessage<HelloRequest> { private static readonly pb::MessageParser<HelloRequest> _parser = new pb::MessageParser<HelloRequest>(() => new HelloRequest()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser<HelloRequest> Parser { get { return _parser; } } @@ -67,6 +70,7 @@ namespace Helloworld { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HelloRequest(HelloRequest other) : this() { name_ = other.name_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -99,13 +103,16 @@ namespace Helloworld { return true; } if (Name != other.Name) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -120,6 +127,9 @@ namespace Helloworld { output.WriteRawTag(10); output.WriteString(Name); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -128,6 +138,9 @@ namespace Helloworld { if (Name.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -139,6 +152,7 @@ namespace Helloworld { if (other.Name.Length != 0) { Name = other.Name; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -147,7 +161,7 @@ namespace Helloworld { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Name = input.ReadString(); @@ -164,6 +178,7 @@ namespace Helloworld { /// </summary> public sealed partial class HelloReply : pb::IMessage<HelloReply> { private static readonly pb::MessageParser<HelloReply> _parser = new pb::MessageParser<HelloReply>(() => new HelloReply()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser<HelloReply> Parser { get { return _parser; } } @@ -187,6 +202,7 @@ namespace Helloworld { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HelloReply(HelloReply other) : this() { message_ = other.message_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -219,13 +235,16 @@ namespace Helloworld { return true; } if (Message != other.Message) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Message.Length != 0) hash ^= Message.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -240,6 +259,9 @@ namespace Helloworld { output.WriteRawTag(10); output.WriteString(Message); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -248,6 +270,9 @@ namespace Helloworld { if (Message.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -259,6 +284,7 @@ namespace Helloworld { if (other.Message.Length != 0) { Message = other.Message; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -267,7 +293,7 @@ namespace Helloworld { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Message = input.ReadString(); diff --git a/examples/csharp/Helloworld/Greeter/HelloworldGrpc.cs b/examples/csharp/Helloworld/Greeter/HelloworldGrpc.cs index c808884e579..d6b959adc64 100644 --- a/examples/csharp/Helloworld/Greeter/HelloworldGrpc.cs +++ b/examples/csharp/Helloworld/Greeter/HelloworldGrpc.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: helloworld.proto +// <auto-generated> +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: helloworld.proto +// </auto-generated> // Original file comments: // Copyright 2015 gRPC authors. // @@ -15,12 +17,9 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#pragma warning disable 1591 +#pragma warning disable 0414, 1591 #region Designer generated code -using System; -using System.Threading; -using System.Threading.Tasks; using grpc = global::Grpc.Core; namespace Helloworld { @@ -31,15 +30,15 @@ namespace Helloworld { { static readonly string __ServiceName = "helloworld.Greeter"; - static readonly grpc::Marshaller<global::Helloworld.HelloRequest> __Marshaller_HelloRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloRequest.Parser.ParseFrom); - static readonly grpc::Marshaller<global::Helloworld.HelloReply> __Marshaller_HelloReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloReply.Parser.ParseFrom); + static readonly grpc::Marshaller<global::Helloworld.HelloRequest> __Marshaller_helloworld_HelloRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloRequest.Parser.ParseFrom); + static readonly grpc::Marshaller<global::Helloworld.HelloReply> __Marshaller_helloworld_HelloReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloReply.Parser.ParseFrom); static readonly grpc::Method<global::Helloworld.HelloRequest, global::Helloworld.HelloReply> __Method_SayHello = new grpc::Method<global::Helloworld.HelloRequest, global::Helloworld.HelloReply>( grpc::MethodType.Unary, __ServiceName, "SayHello", - __Marshaller_HelloRequest, - __Marshaller_HelloReply); + __Marshaller_helloworld_HelloRequest, + __Marshaller_helloworld_HelloReply); /// <summary>Service descriptor</summary> public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor @@ -94,7 +93,7 @@ namespace Helloworld { /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> - public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return SayHello(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } @@ -116,7 +115,7 @@ namespace Helloworld { /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> - public virtual grpc::AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return SayHelloAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } diff --git a/examples/csharp/Helloworld/generate_protos.bat b/examples/csharp/Helloworld/generate_protos.bat index dcf60848f77..ab0c0eb46a4 100644 --- a/examples/csharp/Helloworld/generate_protos.bat +++ b/examples/csharp/Helloworld/generate_protos.bat @@ -19,8 +19,9 @@ setlocal @rem enter this directory cd /d %~dp0 -set PROTOC=%UserProfile%\.nuget\packages\Google.Protobuf.Tools\3.5.0\tools\windows_x64\protoc.exe -set PLUGIN=%UserProfile%\.nuget\packages\Grpc.Tools\1.8.0\tools\windows_x64\grpc_csharp_plugin.exe +@rem packages will be available in nuget cache directory once the project is built or after "dotnet restore" +set PROTOC=%UserProfile%\.nuget\packages\Google.Protobuf.Tools\3.6.1\tools\windows_x64\protoc.exe +set PLUGIN=%UserProfile%\.nuget\packages\Grpc.Tools\1.14.1\tools\windows_x64\grpc_csharp_plugin.exe %PROTOC% -I../../protos --csharp_out Greeter ../../protos/helloworld.proto --grpc_out Greeter --plugin=protoc-gen-grpc=%PLUGIN% diff --git a/examples/csharp/HelloworldLegacyCsproj/Greeter/Greeter.csproj b/examples/csharp/HelloworldLegacyCsproj/Greeter/Greeter.csproj index ab584c86d3e..197a9fb6257 100644 --- a/examples/csharp/HelloworldLegacyCsproj/Greeter/Greeter.csproj +++ b/examples/csharp/HelloworldLegacyCsproj/Greeter/Greeter.csproj @@ -32,18 +32,17 @@ <ConsolePause>false</ConsolePause> </PropertyGroup> <ItemGroup> - <Reference Include="Google.Protobuf, Version=3.5.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> - <HintPath>..\packages\Google.Protobuf.3.5.0\lib\net45\Google.Protobuf.dll</HintPath> - <Private>True</Private> + <Reference Include="Google.Protobuf, Version=3.6.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> + <HintPath>..\packages\Google.Protobuf.3.6.1\lib\net45\Google.Protobuf.dll</HintPath> + </Reference> + <Reference Include="Grpc.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> + <HintPath>..\packages\Grpc.Core.1.14.1\lib\net45\Grpc.Core.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Interactive.Async, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> <HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath> <Private>True</Private> </Reference> - <Reference Include="Grpc.Core"> - <HintPath>..\packages\Grpc.Core.1.13.1\lib\net45\Grpc.Core.dll</HintPath> - </Reference> <Reference Include="Microsoft.CSharp" /> </ItemGroup> <ItemGroup> @@ -62,5 +61,11 @@ <None Include="packages.config" /> </ItemGroup> <ItemGroup /> - <Import Project="..\packages\Grpc.Core.1.13.1\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.13.1\build\net45\Grpc.Core.targets')" /> + <Import Project="..\packages\Grpc.Core.1.14.1\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.14.1\build\net45\Grpc.Core.targets')" /> + <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> + <PropertyGroup> + <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> + </PropertyGroup> + <Error Condition="!Exists('..\packages\Grpc.Core.1.14.1\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.1.14.1\build\net45\Grpc.Core.targets'))" /> + </Target> </Project> \ No newline at end of file diff --git a/examples/csharp/HelloworldLegacyCsproj/Greeter/Helloworld.cs b/examples/csharp/HelloworldLegacyCsproj/Greeter/Helloworld.cs index ecfc8e131cb..e008ec27e54 100644 --- a/examples/csharp/HelloworldLegacyCsproj/Greeter/Helloworld.cs +++ b/examples/csharp/HelloworldLegacyCsproj/Greeter/Helloworld.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: helloworld.proto +// <auto-generated> +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: helloworld.proto +// </auto-generated> #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -44,6 +46,7 @@ namespace Helloworld { /// </summary> public sealed partial class HelloRequest : pb::IMessage<HelloRequest> { private static readonly pb::MessageParser<HelloRequest> _parser = new pb::MessageParser<HelloRequest>(() => new HelloRequest()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser<HelloRequest> Parser { get { return _parser; } } @@ -67,6 +70,7 @@ namespace Helloworld { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HelloRequest(HelloRequest other) : this() { name_ = other.name_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -99,13 +103,16 @@ namespace Helloworld { return true; } if (Name != other.Name) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -120,6 +127,9 @@ namespace Helloworld { output.WriteRawTag(10); output.WriteString(Name); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -128,6 +138,9 @@ namespace Helloworld { if (Name.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -139,6 +152,7 @@ namespace Helloworld { if (other.Name.Length != 0) { Name = other.Name; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -147,7 +161,7 @@ namespace Helloworld { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Name = input.ReadString(); @@ -164,6 +178,7 @@ namespace Helloworld { /// </summary> public sealed partial class HelloReply : pb::IMessage<HelloReply> { private static readonly pb::MessageParser<HelloReply> _parser = new pb::MessageParser<HelloReply>(() => new HelloReply()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser<HelloReply> Parser { get { return _parser; } } @@ -187,6 +202,7 @@ namespace Helloworld { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HelloReply(HelloReply other) : this() { message_ = other.message_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -219,13 +235,16 @@ namespace Helloworld { return true; } if (Message != other.Message) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Message.Length != 0) hash ^= Message.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -240,6 +259,9 @@ namespace Helloworld { output.WriteRawTag(10); output.WriteString(Message); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -248,6 +270,9 @@ namespace Helloworld { if (Message.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -259,6 +284,7 @@ namespace Helloworld { if (other.Message.Length != 0) { Message = other.Message; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -267,7 +293,7 @@ namespace Helloworld { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Message = input.ReadString(); diff --git a/examples/csharp/HelloworldLegacyCsproj/Greeter/HelloworldGrpc.cs b/examples/csharp/HelloworldLegacyCsproj/Greeter/HelloworldGrpc.cs index c808884e579..d6b959adc64 100644 --- a/examples/csharp/HelloworldLegacyCsproj/Greeter/HelloworldGrpc.cs +++ b/examples/csharp/HelloworldLegacyCsproj/Greeter/HelloworldGrpc.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: helloworld.proto +// <auto-generated> +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: helloworld.proto +// </auto-generated> // Original file comments: // Copyright 2015 gRPC authors. // @@ -15,12 +17,9 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#pragma warning disable 1591 +#pragma warning disable 0414, 1591 #region Designer generated code -using System; -using System.Threading; -using System.Threading.Tasks; using grpc = global::Grpc.Core; namespace Helloworld { @@ -31,15 +30,15 @@ namespace Helloworld { { static readonly string __ServiceName = "helloworld.Greeter"; - static readonly grpc::Marshaller<global::Helloworld.HelloRequest> __Marshaller_HelloRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloRequest.Parser.ParseFrom); - static readonly grpc::Marshaller<global::Helloworld.HelloReply> __Marshaller_HelloReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloReply.Parser.ParseFrom); + static readonly grpc::Marshaller<global::Helloworld.HelloRequest> __Marshaller_helloworld_HelloRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloRequest.Parser.ParseFrom); + static readonly grpc::Marshaller<global::Helloworld.HelloReply> __Marshaller_helloworld_HelloReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloReply.Parser.ParseFrom); static readonly grpc::Method<global::Helloworld.HelloRequest, global::Helloworld.HelloReply> __Method_SayHello = new grpc::Method<global::Helloworld.HelloRequest, global::Helloworld.HelloReply>( grpc::MethodType.Unary, __ServiceName, "SayHello", - __Marshaller_HelloRequest, - __Marshaller_HelloReply); + __Marshaller_helloworld_HelloRequest, + __Marshaller_helloworld_HelloReply); /// <summary>Service descriptor</summary> public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor @@ -94,7 +93,7 @@ namespace Helloworld { /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> - public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return SayHello(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } @@ -116,7 +115,7 @@ namespace Helloworld { /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> - public virtual grpc::AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return SayHelloAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } diff --git a/examples/csharp/HelloworldLegacyCsproj/Greeter/packages.config b/examples/csharp/HelloworldLegacyCsproj/Greeter/packages.config index 8e61429a8ea..23857be22fa 100644 --- a/examples/csharp/HelloworldLegacyCsproj/Greeter/packages.config +++ b/examples/csharp/HelloworldLegacyCsproj/Greeter/packages.config @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Google.Protobuf" version="3.5.0" targetFramework="net45" /> - <package id="Grpc" version="1.13.1" targetFramework="net45" /> - <package id="Grpc.Core" version="1.13.1" targetFramework="net45" /> - <package id="Grpc.Tools" version="1.13.1" targetFramework="net45" /> + <package id="Google.Protobuf" version="3.6.1" targetFramework="net45" /> + <package id="Grpc" version="1.14.1" targetFramework="net45" /> + <package id="Grpc.Core" version="1.14.1" targetFramework="net45" /> + <package id="Grpc.Tools" version="1.14.1" targetFramework="net45" /> <package id="System.Interactive.Async" version="3.1.1" targetFramework="net45" /> </packages> \ No newline at end of file diff --git a/examples/csharp/HelloworldLegacyCsproj/GreeterClient/GreeterClient.csproj b/examples/csharp/HelloworldLegacyCsproj/GreeterClient/GreeterClient.csproj index 2d2961d1289..3bb7ff1ee13 100644 --- a/examples/csharp/HelloworldLegacyCsproj/GreeterClient/GreeterClient.csproj +++ b/examples/csharp/HelloworldLegacyCsproj/GreeterClient/GreeterClient.csproj @@ -32,18 +32,17 @@ <Externalconsole>true</Externalconsole> </PropertyGroup> <ItemGroup> - <Reference Include="Google.Protobuf, Version=3.5.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> - <HintPath>..\packages\Google.Protobuf.3.5.0\lib\net45\Google.Protobuf.dll</HintPath> - <Private>True</Private> + <Reference Include="Google.Protobuf, Version=3.6.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> + <HintPath>..\packages\Google.Protobuf.3.6.1\lib\net45\Google.Protobuf.dll</HintPath> + </Reference> + <Reference Include="Grpc.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> + <HintPath>..\packages\Grpc.Core.1.14.1\lib\net45\Grpc.Core.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Interactive.Async, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> <HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath> <Private>True</Private> </Reference> - <Reference Include="Grpc.Core"> - <HintPath>..\packages\Grpc.Core.1.13.1\lib\net45\Grpc.Core.dll</HintPath> - </Reference> <Reference Include="Microsoft.CSharp" /> </ItemGroup> <ItemGroup> @@ -60,5 +59,11 @@ <ItemGroup> <None Include="packages.config" /> </ItemGroup> - <Import Project="..\packages\Grpc.Core.1.13.1\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.13.1\build\net45\Grpc.Core.targets')" /> + <Import Project="..\packages\Grpc.Core.1.14.1\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.14.1\build\net45\Grpc.Core.targets')" /> + <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> + <PropertyGroup> + <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> + </PropertyGroup> + <Error Condition="!Exists('..\packages\Grpc.Core.1.14.1\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.1.14.1\build\net45\Grpc.Core.targets'))" /> + </Target> </Project> \ No newline at end of file diff --git a/examples/csharp/HelloworldLegacyCsproj/GreeterClient/packages.config b/examples/csharp/HelloworldLegacyCsproj/GreeterClient/packages.config index da7dbcd8cb5..df4df8282c4 100644 --- a/examples/csharp/HelloworldLegacyCsproj/GreeterClient/packages.config +++ b/examples/csharp/HelloworldLegacyCsproj/GreeterClient/packages.config @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Google.Protobuf" version="3.5.0" targetFramework="net45" /> - <package id="Grpc" version="1.13.1" targetFramework="net45" /> - <package id="Grpc.Core" version="1.13.1" targetFramework="net45" /> + <package id="Google.Protobuf" version="3.6.1" targetFramework="net45" /> + <package id="Grpc" version="1.14.1" targetFramework="net45" /> + <package id="Grpc.Core" version="1.14.1" targetFramework="net45" /> <package id="System.Interactive.Async" version="3.1.1" targetFramework="net45" /> </packages> \ No newline at end of file diff --git a/examples/csharp/HelloworldLegacyCsproj/GreeterServer/GreeterServer.csproj b/examples/csharp/HelloworldLegacyCsproj/GreeterServer/GreeterServer.csproj index 1d47d705955..4396b04efeb 100644 --- a/examples/csharp/HelloworldLegacyCsproj/GreeterServer/GreeterServer.csproj +++ b/examples/csharp/HelloworldLegacyCsproj/GreeterServer/GreeterServer.csproj @@ -32,18 +32,17 @@ <Externalconsole>true</Externalconsole> </PropertyGroup> <ItemGroup> - <Reference Include="Google.Protobuf, Version=3.5.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> - <HintPath>..\packages\Google.Protobuf.3.5.0\lib\net45\Google.Protobuf.dll</HintPath> - <Private>True</Private> + <Reference Include="Google.Protobuf, Version=3.6.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> + <HintPath>..\packages\Google.Protobuf.3.6.1\lib\net45\Google.Protobuf.dll</HintPath> + </Reference> + <Reference Include="Grpc.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> + <HintPath>..\packages\Grpc.Core.1.14.1\lib\net45\Grpc.Core.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Interactive.Async, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> <HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath> <Private>True</Private> </Reference> - <Reference Include="Grpc.Core"> - <HintPath>..\packages\Grpc.Core.1.13.1\lib\net45\Grpc.Core.dll</HintPath> - </Reference> <Reference Include="Microsoft.CSharp" /> </ItemGroup> <ItemGroup> @@ -60,5 +59,11 @@ <ItemGroup> <None Include="packages.config" /> </ItemGroup> - <Import Project="..\packages\Grpc.Core.1.13.1\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.13.1\build\net45\Grpc.Core.targets')" /> + <Import Project="..\packages\Grpc.Core.1.14.1\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.14.1\build\net45\Grpc.Core.targets')" /> + <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> + <PropertyGroup> + <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> + </PropertyGroup> + <Error Condition="!Exists('..\packages\Grpc.Core.1.14.1\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.1.14.1\build\net45\Grpc.Core.targets'))" /> + </Target> </Project> \ No newline at end of file diff --git a/examples/csharp/HelloworldLegacyCsproj/GreeterServer/packages.config b/examples/csharp/HelloworldLegacyCsproj/GreeterServer/packages.config index da7dbcd8cb5..df4df8282c4 100644 --- a/examples/csharp/HelloworldLegacyCsproj/GreeterServer/packages.config +++ b/examples/csharp/HelloworldLegacyCsproj/GreeterServer/packages.config @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Google.Protobuf" version="3.5.0" targetFramework="net45" /> - <package id="Grpc" version="1.13.1" targetFramework="net45" /> - <package id="Grpc.Core" version="1.13.1" targetFramework="net45" /> + <package id="Google.Protobuf" version="3.6.1" targetFramework="net45" /> + <package id="Grpc" version="1.14.1" targetFramework="net45" /> + <package id="Grpc.Core" version="1.14.1" targetFramework="net45" /> <package id="System.Interactive.Async" version="3.1.1" targetFramework="net45" /> </packages> \ No newline at end of file diff --git a/examples/csharp/HelloworldLegacyCsproj/generate_protos.bat b/examples/csharp/HelloworldLegacyCsproj/generate_protos.bat index 45b097e837e..d1e7160f91e 100644 --- a/examples/csharp/HelloworldLegacyCsproj/generate_protos.bat +++ b/examples/csharp/HelloworldLegacyCsproj/generate_protos.bat @@ -19,7 +19,7 @@ setlocal @rem enter this directory cd /d %~dp0 -set TOOLS_PATH=packages\Grpc.Tools.1.8.0\tools\windows_x86 +set TOOLS_PATH=packages\Grpc.Tools.1.14.1\tools\windows_x86 %TOOLS_PATH%\protoc.exe -I../../protos --csharp_out Greeter ../../protos/helloworld.proto --grpc_out Greeter --plugin=protoc-gen-grpc=%TOOLS_PATH%\grpc_csharp_plugin.exe diff --git a/examples/csharp/RouteGuide/RouteGuide/RouteGuide.cs b/examples/csharp/RouteGuide/RouteGuide/RouteGuide.cs index 603809ee76f..10c9aec5f80 100644 --- a/examples/csharp/RouteGuide/RouteGuide/RouteGuide.cs +++ b/examples/csharp/RouteGuide/RouteGuide/RouteGuide.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: route_guide.proto +// <auto-generated> +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: route_guide.proto +// </auto-generated> #pragma warning disable 1591, 0612, 3021 #region Designer generated code @@ -60,6 +62,7 @@ namespace Routeguide { /// </summary> public sealed partial class Point : pb::IMessage<Point> { private static readonly pb::MessageParser<Point> _parser = new pb::MessageParser<Point>(() => new Point()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser<Point> Parser { get { return _parser; } } @@ -84,6 +87,7 @@ namespace Routeguide { public Point(Point other) : this() { latitude_ = other.latitude_; longitude_ = other.longitude_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -128,7 +132,7 @@ namespace Routeguide { } if (Latitude != other.Latitude) return false; if (Longitude != other.Longitude) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -136,6 +140,9 @@ namespace Routeguide { int hash = 1; if (Latitude != 0) hash ^= Latitude.GetHashCode(); if (Longitude != 0) hash ^= Longitude.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -154,6 +161,9 @@ namespace Routeguide { output.WriteRawTag(16); output.WriteInt32(Longitude); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -165,6 +175,9 @@ namespace Routeguide { if (Longitude != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(Longitude); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -179,6 +192,7 @@ namespace Routeguide { if (other.Longitude != 0) { Longitude = other.Longitude; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -187,7 +201,7 @@ namespace Routeguide { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { Latitude = input.ReadInt32(); @@ -209,6 +223,7 @@ namespace Routeguide { /// </summary> public sealed partial class Rectangle : pb::IMessage<Rectangle> { private static readonly pb::MessageParser<Rectangle> _parser = new pb::MessageParser<Rectangle>(() => new Rectangle()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser<Rectangle> Parser { get { return _parser; } } @@ -231,8 +246,9 @@ namespace Routeguide { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Rectangle(Rectangle other) : this() { - Lo = other.lo_ != null ? other.Lo.Clone() : null; - Hi = other.hi_ != null ? other.Hi.Clone() : null; + lo_ = other.lo_ != null ? other.lo_.Clone() : null; + hi_ = other.hi_ != null ? other.hi_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -283,7 +299,7 @@ namespace Routeguide { } if (!object.Equals(Lo, other.Lo)) return false; if (!object.Equals(Hi, other.Hi)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -291,6 +307,9 @@ namespace Routeguide { int hash = 1; if (lo_ != null) hash ^= Lo.GetHashCode(); if (hi_ != null) hash ^= Hi.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -309,6 +328,9 @@ namespace Routeguide { output.WriteRawTag(18); output.WriteMessage(Hi); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -320,6 +342,9 @@ namespace Routeguide { if (hi_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Hi); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -340,6 +365,7 @@ namespace Routeguide { } Hi.MergeFrom(other.Hi); } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -348,7 +374,7 @@ namespace Routeguide { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { if (lo_ == null) { @@ -377,6 +403,7 @@ namespace Routeguide { /// </summary> public sealed partial class Feature : pb::IMessage<Feature> { private static readonly pb::MessageParser<Feature> _parser = new pb::MessageParser<Feature>(() => new Feature()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser<Feature> Parser { get { return _parser; } } @@ -400,7 +427,8 @@ namespace Routeguide { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Feature(Feature other) : this() { name_ = other.name_; - Location = other.location_ != null ? other.Location.Clone() : null; + location_ = other.location_ != null ? other.location_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -451,7 +479,7 @@ namespace Routeguide { } if (Name != other.Name) return false; if (!object.Equals(Location, other.Location)) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -459,6 +487,9 @@ namespace Routeguide { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); if (location_ != null) hash ^= Location.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -477,6 +508,9 @@ namespace Routeguide { output.WriteRawTag(18); output.WriteMessage(Location); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -488,6 +522,9 @@ namespace Routeguide { if (location_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Location); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -505,6 +542,7 @@ namespace Routeguide { } Location.MergeFrom(other.Location); } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -513,7 +551,7 @@ namespace Routeguide { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Name = input.ReadString(); @@ -537,6 +575,7 @@ namespace Routeguide { /// </summary> public sealed partial class RouteNote : pb::IMessage<RouteNote> { private static readonly pb::MessageParser<RouteNote> _parser = new pb::MessageParser<RouteNote>(() => new RouteNote()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser<RouteNote> Parser { get { return _parser; } } @@ -559,8 +598,9 @@ namespace Routeguide { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public RouteNote(RouteNote other) : this() { - Location = other.location_ != null ? other.Location.Clone() : null; + location_ = other.location_ != null ? other.location_.Clone() : null; message_ = other.message_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -611,7 +651,7 @@ namespace Routeguide { } if (!object.Equals(Location, other.Location)) return false; if (Message != other.Message) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -619,6 +659,9 @@ namespace Routeguide { int hash = 1; if (location_ != null) hash ^= Location.GetHashCode(); if (Message.Length != 0) hash ^= Message.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -637,6 +680,9 @@ namespace Routeguide { output.WriteRawTag(18); output.WriteString(Message); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -648,6 +694,9 @@ namespace Routeguide { if (Message.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -665,6 +714,7 @@ namespace Routeguide { if (other.Message.Length != 0) { Message = other.Message; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -673,7 +723,7 @@ namespace Routeguide { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { if (location_ == null) { @@ -701,6 +751,7 @@ namespace Routeguide { /// </summary> public sealed partial class RouteSummary : pb::IMessage<RouteSummary> { private static readonly pb::MessageParser<RouteSummary> _parser = new pb::MessageParser<RouteSummary>(() => new RouteSummary()); + private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser<RouteSummary> Parser { get { return _parser; } } @@ -727,6 +778,7 @@ namespace Routeguide { featureCount_ = other.featureCount_; distance_ = other.distance_; elapsedTime_ = other.elapsedTime_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -807,7 +859,7 @@ namespace Routeguide { if (FeatureCount != other.FeatureCount) return false; if (Distance != other.Distance) return false; if (ElapsedTime != other.ElapsedTime) return false; - return true; + return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -817,6 +869,9 @@ namespace Routeguide { if (FeatureCount != 0) hash ^= FeatureCount.GetHashCode(); if (Distance != 0) hash ^= Distance.GetHashCode(); if (ElapsedTime != 0) hash ^= ElapsedTime.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } return hash; } @@ -843,6 +898,9 @@ namespace Routeguide { output.WriteRawTag(32); output.WriteInt32(ElapsedTime); } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -860,6 +918,9 @@ namespace Routeguide { if (ElapsedTime != 0) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(ElapsedTime); } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } return size; } @@ -880,6 +941,7 @@ namespace Routeguide { if (other.ElapsedTime != 0) { ElapsedTime = other.ElapsedTime; } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -888,7 +950,7 @@ namespace Routeguide { while ((tag = input.ReadTag()) != 0) { switch(tag) { default: - input.SkipLastField(); + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { PointCount = input.ReadInt32(); diff --git a/examples/csharp/RouteGuide/RouteGuide/RouteGuide.csproj b/examples/csharp/RouteGuide/RouteGuide/RouteGuide.csproj index 7419f1a277d..e1c44ecf3c4 100644 --- a/examples/csharp/RouteGuide/RouteGuide/RouteGuide.csproj +++ b/examples/csharp/RouteGuide/RouteGuide/RouteGuide.csproj @@ -9,10 +9,10 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="Google.Protobuf" Version="3.5.0" /> - <PackageReference Include="Google.Protobuf.Tools" Version="3.5.0" /> - <PackageReference Include="Grpc" Version="1.13.1" /> - <PackageReference Include="Grpc.Tools" Version="1.13.1" /> + <PackageReference Include="Google.Protobuf" Version="3.6.1" /> + <PackageReference Include="Google.Protobuf.Tools" Version="3.6.1" /> + <PackageReference Include="Grpc" Version="1.14.1" /> + <PackageReference Include="Grpc.Tools" Version="1.14.1" /> <PackageReference Include="Newtonsoft.Json" Version="9.0.1" /> </ItemGroup> diff --git a/examples/csharp/RouteGuide/RouteGuide/RouteGuideGrpc.cs b/examples/csharp/RouteGuide/RouteGuide/RouteGuideGrpc.cs index 765d5d520bc..445708e4469 100644 --- a/examples/csharp/RouteGuide/RouteGuide/RouteGuideGrpc.cs +++ b/examples/csharp/RouteGuide/RouteGuide/RouteGuideGrpc.cs @@ -1,5 +1,7 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: route_guide.proto +// <auto-generated> +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: route_guide.proto +// </auto-generated> // Original file comments: // Copyright 2015 gRPC authors. // @@ -15,12 +17,9 @@ // See the License for the specific language governing permissions and // limitations under the License. // -#pragma warning disable 1591 +#pragma warning disable 0414, 1591 #region Designer generated code -using System; -using System.Threading; -using System.Threading.Tasks; using grpc = global::Grpc.Core; namespace Routeguide { @@ -31,39 +30,39 @@ namespace Routeguide { { static readonly string __ServiceName = "routeguide.RouteGuide"; - static readonly grpc::Marshaller<global::Routeguide.Point> __Marshaller_Point = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Point.Parser.ParseFrom); - static readonly grpc::Marshaller<global::Routeguide.Feature> __Marshaller_Feature = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Feature.Parser.ParseFrom); - static readonly grpc::Marshaller<global::Routeguide.Rectangle> __Marshaller_Rectangle = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Rectangle.Parser.ParseFrom); - static readonly grpc::Marshaller<global::Routeguide.RouteSummary> __Marshaller_RouteSummary = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.RouteSummary.Parser.ParseFrom); - static readonly grpc::Marshaller<global::Routeguide.RouteNote> __Marshaller_RouteNote = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.RouteNote.Parser.ParseFrom); + static readonly grpc::Marshaller<global::Routeguide.Point> __Marshaller_routeguide_Point = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Point.Parser.ParseFrom); + static readonly grpc::Marshaller<global::Routeguide.Feature> __Marshaller_routeguide_Feature = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Feature.Parser.ParseFrom); + static readonly grpc::Marshaller<global::Routeguide.Rectangle> __Marshaller_routeguide_Rectangle = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Rectangle.Parser.ParseFrom); + static readonly grpc::Marshaller<global::Routeguide.RouteSummary> __Marshaller_routeguide_RouteSummary = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.RouteSummary.Parser.ParseFrom); + static readonly grpc::Marshaller<global::Routeguide.RouteNote> __Marshaller_routeguide_RouteNote = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.RouteNote.Parser.ParseFrom); static readonly grpc::Method<global::Routeguide.Point, global::Routeguide.Feature> __Method_GetFeature = new grpc::Method<global::Routeguide.Point, global::Routeguide.Feature>( grpc::MethodType.Unary, __ServiceName, "GetFeature", - __Marshaller_Point, - __Marshaller_Feature); + __Marshaller_routeguide_Point, + __Marshaller_routeguide_Feature); static readonly grpc::Method<global::Routeguide.Rectangle, global::Routeguide.Feature> __Method_ListFeatures = new grpc::Method<global::Routeguide.Rectangle, global::Routeguide.Feature>( grpc::MethodType.ServerStreaming, __ServiceName, "ListFeatures", - __Marshaller_Rectangle, - __Marshaller_Feature); + __Marshaller_routeguide_Rectangle, + __Marshaller_routeguide_Feature); static readonly grpc::Method<global::Routeguide.Point, global::Routeguide.RouteSummary> __Method_RecordRoute = new grpc::Method<global::Routeguide.Point, global::Routeguide.RouteSummary>( grpc::MethodType.ClientStreaming, __ServiceName, "RecordRoute", - __Marshaller_Point, - __Marshaller_RouteSummary); + __Marshaller_routeguide_Point, + __Marshaller_routeguide_RouteSummary); static readonly grpc::Method<global::Routeguide.RouteNote, global::Routeguide.RouteNote> __Method_RouteChat = new grpc::Method<global::Routeguide.RouteNote, global::Routeguide.RouteNote>( grpc::MethodType.DuplexStreaming, __ServiceName, "RouteChat", - __Marshaller_RouteNote, - __Marshaller_RouteNote); + __Marshaller_routeguide_RouteNote, + __Marshaller_routeguide_RouteNote); /// <summary>Service descriptor</summary> public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor @@ -174,7 +173,7 @@ namespace Routeguide { /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> - public virtual global::Routeguide.Feature GetFeature(global::Routeguide.Point request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual global::Routeguide.Feature GetFeature(global::Routeguide.Point request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return GetFeature(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } @@ -206,7 +205,7 @@ namespace Routeguide { /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> - public virtual grpc::AsyncUnaryCall<global::Routeguide.Feature> GetFeatureAsync(global::Routeguide.Point request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncUnaryCall<global::Routeguide.Feature> GetFeatureAsync(global::Routeguide.Point request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return GetFeatureAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } @@ -238,7 +237,7 @@ namespace Routeguide { /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> - public virtual grpc::AsyncServerStreamingCall<global::Routeguide.Feature> ListFeatures(global::Routeguide.Rectangle request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncServerStreamingCall<global::Routeguide.Feature> ListFeatures(global::Routeguide.Rectangle request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return ListFeatures(request, new grpc::CallOptions(headers, deadline, cancellationToken)); } @@ -267,7 +266,7 @@ namespace Routeguide { /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> - public virtual grpc::AsyncClientStreamingCall<global::Routeguide.Point, global::Routeguide.RouteSummary> RecordRoute(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncClientStreamingCall<global::Routeguide.Point, global::Routeguide.RouteSummary> RecordRoute(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return RecordRoute(new grpc::CallOptions(headers, deadline, cancellationToken)); } @@ -293,7 +292,7 @@ namespace Routeguide { /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The call object.</returns> - public virtual grpc::AsyncDuplexStreamingCall<global::Routeguide.RouteNote, global::Routeguide.RouteNote> RouteChat(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual grpc::AsyncDuplexStreamingCall<global::Routeguide.RouteNote, global::Routeguide.RouteNote> RouteChat(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) { return RouteChat(new grpc::CallOptions(headers, deadline, cancellationToken)); } diff --git a/examples/csharp/RouteGuide/generate_protos.bat b/examples/csharp/RouteGuide/generate_protos.bat index a8c9cb505a1..f3a4382cf19 100644 --- a/examples/csharp/RouteGuide/generate_protos.bat +++ b/examples/csharp/RouteGuide/generate_protos.bat @@ -19,8 +19,10 @@ setlocal @rem enter this directory cd /d %~dp0 -set TOOLS_PATH=packages\Grpc.Tools.1.8.0\tools\windows_x86 +@rem packages will be available in nuget cache directory once the project is built or after "dotnet restore" +set PROTOC=%UserProfile%\.nuget\packages\Google.Protobuf.Tools\3.6.1\tools\windows_x64\protoc.exe +set PLUGIN=%UserProfile%\.nuget\packages\Grpc.Tools\1.14.1\tools\windows_x64\grpc_csharp_plugin.exe -%TOOLS_PATH%\protoc.exe -I../../protos --csharp_out RouteGuide ../../protos/route_guide.proto --grpc_out RouteGuide --plugin=protoc-gen-grpc=%TOOLS_PATH%\grpc_csharp_plugin.exe +%PROTOC% -I../../protos --csharp_out RouteGuide ../../protos/route_guide.proto --grpc_out RouteGuide --plugin=protoc-gen-grpc=%PLUGIN% endlocal