Initializes a new instance ofClientBaseclass that
throwsNotImplementedExceptionupon invocation of any RPC.
This constructor is only provided to allow creation of test doubles
for client classes (e.g. mocking requires a parameterless constructor).
Creates a new client that sets host field for calls explicitly.
gRPC supports multiple "hosts" being served by a single server.
By default (if a client was not created by calling this method),
hostnullwith the meaning "use default host" is used.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003e\u003ccode\u003eClientBase<T>\u003c/code\u003e is a generic base class for creating client-side stubs in gRPC.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides multiple constructors to initialize a new client instance, including options for a parameterless constructor for mocking, using a \u003ccode\u003eCallInvoker\u003c/code\u003e, a \u003ccode\u003eChannelBase\u003c/code\u003e, or a \u003ccode\u003eClientBaseConfiguration\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eClientBase<T>\u003c/code\u003e inherits from \u003ccode\u003eClientBase\u003c/code\u003e, which in turn inherits from \u003ccode\u003eobject\u003c/code\u003e, providing a set of inherited members such as \u003ccode\u003eCallInvoker\u003c/code\u003e, \u003ccode\u003eEquals\u003c/code\u003e, \u003ccode\u003eGetHashCode\u003c/code\u003e, \u003ccode\u003eGetType\u003c/code\u003e, \u003ccode\u003eMemberwiseClone\u003c/code\u003e, \u003ccode\u003eReferenceEquals\u003c/code\u003e, and \u003ccode\u003eToString\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eNewInstance\u003c/code\u003e is an abstract method that allows the creation of a new client instance based on the provided \u003ccode\u003eClientBaseConfiguration\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eWithHost\u003c/code\u003e method enables the creation of a new client instance with an explicitly set host field, useful for scenarios where multiple hosts are served by a single server, allowing default host to be used if not set.\u003c/p\u003e\n"]]],[],null,["# Class ClientBase<T> (2.66.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.66.0 (latest)](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase-1)\n- [2.63.0](/dotnet/docs/reference/Grpc.Core/2.63.0/Grpc.Core.ClientBase-1)\n- [2.48.0](/dotnet/docs/reference/Grpc.Core/2.48.0/Grpc.Core.ClientBase-1) \n\n public abstract class ClientBase\u003cT\u003e : ClientBase where T : ClientBase\u003cT\u003e\n\nGeneric base class for client-side stubs. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e [ClientBase](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase) \\\u003e ClientBase\\\u003cT\\\u003e \n\nInherited Members\n-----------------\n\n[ClientBase.CallInvoker](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase#Grpc_Core_ClientBase_CallInvoker) \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Grpc.Core](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core)\n\nAssembly\n--------\n\nGrpc.Core.Api.dll\n\nConstructors\n------------\n\n### ClientBase()\n\n protected ClientBase()\n\nInitializes a new instance of `ClientBase` class that\nthrows `NotImplementedException` upon invocation of any RPC.\nThis constructor is only provided to allow creation of test doubles\nfor client classes (e.g. mocking requires a parameterless constructor).\n\n### ClientBase(CallInvoker)\n\n public ClientBase(CallInvoker callInvoker)\n\nInitializes a new instance of `ClientBase` class.\n\n### ClientBase(ChannelBase)\n\n public ClientBase(ChannelBase channel)\n\nInitializes a new instance of `ClientBase` class.\n\n### ClientBase(ClientBaseConfiguration)\n\n protected ClientBase(ClientBase.ClientBaseConfiguration configuration)\n\nInitializes a new instance of `ClientBase` class.\n\nMethods\n-------\n\n### NewInstance(ClientBaseConfiguration)\n\n protected abstract T NewInstance(ClientBase.ClientBaseConfiguration configuration)\n\nCreates a new instance of client from given `ClientBaseConfiguration`.\n\n### WithHost(string)\n\n public T WithHost(string host)\n\nCreates a new client that sets host field for calls explicitly.\ngRPC supports multiple \"hosts\" being served by a single server.\nBy default (if a client was not created by calling this method),\nhost `null` with the meaning \"use default host\" is used."]]