# Namespace Grpc.Core (2.66.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.66.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core)
- [2.63.0](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/2.63.0/Grpc.Core)
- [2.48.0](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/2.48.0/Grpc.Core)

## Classes

### [AsyncClientStreamingCall\<TRequest, TResponse\>](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncClientStreamingCall-2)

Return type for client streaming calls.

### [AsyncDuplexStreamingCall\<TRequest, TResponse\>](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncDuplexStreamingCall-2)

Return type for bidirectional streaming calls.

### [AsyncServerStreamingCall\<TResponse\>](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncServerStreamingCall-1)

Return type for server streaming calls.

### [AsyncStreamReaderExtensions](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncStreamReaderExtensions)

Extension methods for [IAsyncStreamReader\<T\>](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.IAsyncStreamReader-1).

### [AsyncUnaryCall\<TResponse\>](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncUnaryCall-1)

Return type for single request - single response call.

### [AuthContext](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AuthContext)

Authentication context for a call.
AuthContext is the only reliable source of truth when it comes to authenticating calls.
Using any other call/context properties for authentication purposes is wrong and inherently unsafe.
Note: experimental API that can change or be removed without any prior notice.

### [AuthInterceptorContext](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AuthInterceptorContext)

Context for an RPC being intercepted by [AsyncAuthInterceptor](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncAuthInterceptor).

### [AuthProperty](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AuthProperty)

A property of an [AuthContext](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AuthContext).
Note: experimental API that can change or be removed without any prior notice.

### [BindServiceMethodAttribute](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.BindServiceMethodAttribute)

Specifies the location of the service bind method for a gRPC service.
The bind method is typically generated code and is used to register a service's
methods with the server on startup.

The bind method signature takes a [ServiceBinderBase](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServiceBinderBase) and an optional
instance of the service base class, e.g. `static void BindService(ServiceBinderBase, GreeterService)`.

### [CallCredentials](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallCredentials)

Client-side call credentials. Provide authorization with per-call granularity.

### [CallCredentialsConfiguratorBase](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallCredentialsConfiguratorBase)

Base class for objects that can consume configuration from `CallCredentials` objects.
Note: experimental API that can change or be removed without any prior notice.

### [CallInvoker](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallInvoker)

Abstraction of client-side RPC invocation.

### [ChannelBase](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelBase)

Base class for gRPC channel. Channels are an abstraction of long-lived connections to remote servers.

### [ChannelCredentials](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelCredentials)

Client-side channel credentials. Used for creation of a secure channel.

### [ChannelCredentialsConfiguratorBase](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelCredentialsConfiguratorBase)

Base class for objects that can consume configuration from `CallCredentials` objects.
Note: experimental API that can change or be removed without any prior notice.

### [ClientBase](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase)

Base class for client-side stubs.

### [ClientBase.ClientBaseConfiguration](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.ClientBaseConfiguration)

Represents configuration of ClientBase. The class itself is visible to
subclasses, but contents are marked as internal to make the instances opaque.
The verbose name of this class was chosen to make name clash in generated code
less likely.

### [ClientBase\<T\>](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase-1)

Generic base class for client-side stubs.

### [ContextPropagationOptions](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ContextPropagationOptions)

Options for [ContextPropagationToken](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ContextPropagationToken).

### [ContextPropagationToken](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ContextPropagationToken)

Token for propagating context of server side handlers to child calls.
In situations when a backend is making calls to another backend,
it makes sense to propagate properties like deadline and cancellation
token of the server call to the child call.
Underlying gRPC implementation may provide other "opaque" contexts (like tracing context) that
are not explicitly accesible via the public C# API, but this token still allows propagating them.

### [DeserializationContext](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.DeserializationContext)

Provides access to the payload being deserialized when deserializing messages.

### [KeyCertificatePair](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.KeyCertificatePair)

Key certificate pair (in PEM encoding).

### [Marshaller\<T\>](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Marshaller-1)

Encapsulates the logic for serializing and deserializing messages.

### [Marshallers](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Marshallers)

Utilities for creating marshallers.

### [Metadata](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata)

A collection of metadata entries that can be exchanged during a call.
gRPC supports these types of metadata:

- Request headersare sent by the client at the beginning of a remote call before any request messages are sent.
- Response headersare sent by the server at the beginning of a remote call handler before any response messages are sent.
- Response trailersare sent by the server at the end of a remote call along with resulting call status.

<br />

### [Metadata.Entry](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata.Entry)

Metadata entry

### [Method\<TRequest, TResponse\>](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Method-2)

A description of a remote method.

### [RpcException](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.RpcException)

Thrown when remote procedure call fails. Every `RpcException` is associated with a resulting [Status](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.RpcException#Grpc_Core_RpcException_Status) of the call.

### [SerializationContext](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.SerializationContext)

Provides storage for payload when serializing a message.

### [ServerCallContext](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerCallContext)

Context for a server-side call.

### [ServerServiceDefinition](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerServiceDefinition)

Stores mapping of methods to server call handlers.
Normally, the `ServerServiceDefinition` objects will be created by the `BindService` factory method
that is part of the autogenerated code for a protocol buffers service definition.

### [ServerServiceDefinition.Builder](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerServiceDefinition.Builder)

Builder class for [ServerServiceDefinition](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerServiceDefinition).

### [ServiceBinderBase](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServiceBinderBase)

Allows binding server-side method implementations in alternative serving stacks.
Instances of this class are usually populated by the `BindService` method
that is part of the autogenerated code for a protocol buffers service definition.

### [SslCredentials](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.SslCredentials)

Client-side SSL credentials.

### [VerifyPeerContext](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.VerifyPeerContext)

Verification context for VerifyPeerCallback.
Note: experimental API that can change or be removed without any prior notice.

### [VersionInfo](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.VersionInfo)

Provides info about current version of gRPC.
See <https://codingforsmarties.wordpress.com/2016/01/21/how-to-version-assemblies-destined-for-nuget/>
for rationale about assembly versioning.

### [WriteOptions](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.WriteOptions)

Options for write operations.

## Structs

### [CallOptions](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallOptions)

Options for calls made by client.

### [Status](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Status)

Represents RPC result, which consists of [StatusCode](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Status#Grpc_Core_Status_StatusCode) and an optional detail string.

## Interfaces

### [IAsyncStreamReader\<T\>](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.IAsyncStreamReader-1)

A stream of messages to be read.
Messages can be awaited `await reader.MoveNext()`, that returns `true`
if there is a message available and `false` if there are no more messages
(i.e. the stream has been closed).


On the client side, the last invocation of `MoveNext()` either returns `false`
if the call has finished successfully or throws `RpcException` if call finished
with an error. Once the call finishes, subsequent invocations of `MoveNext()` will
continue yielding the same result (returning `false` or throwing an exception).


On the server side, `MoveNext()` does not throw exceptions.
In case of a failure, the request stream will appear to be finished
(`MoveNext` will return `false`) and the `CancellationToken`
associated with the call will be cancelled to signal the failure.

`MoveNext()` operations can be cancelled via a cancellation token. Cancelling
an individual read operation has the same effect as cancelling the entire call
(which will also result in the read operation returning prematurely), but the per-read cancellation
tokens passed to MoveNext() only result in cancelling the call if the read operation haven't finished
yet.

<br />

### [IAsyncStreamWriter\<T\>](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.IAsyncStreamWriter-1)

A writable stream of messages.

### [IClientStreamWriter\<T\>](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.IClientStreamWriter-1)

Client-side writable stream of messages with Close capability.

### [IMethod](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.IMethod)

A non-generic representation of a remote method.

### [IServerStreamWriter\<T\>](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.IServerStreamWriter-1)

A writable stream of messages that is used in server-side handlers.

## Enums

### [MethodType](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.MethodType)

Method types supported by gRPC.

### [StatusCode](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.StatusCode)

Result of a remote procedure call.
Based on grpc_status_code from grpc/status.h

### [WriteFlags](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.WriteFlags)

Flags for write operations.

## Delegates

### [AsyncAuthInterceptor](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncAuthInterceptor)

Asynchronous authentication interceptor for [CallCredentials](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallCredentials).

### [ClientStreamingServerMethod\<TRequest, TResponse\>](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientStreamingServerMethod-2)

Server-side handler for client streaming call.

### [DuplexStreamingServerMethod\<TRequest, TResponse\>](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.DuplexStreamingServerMethod-2)

Server-side handler for bidi streaming call.

### [ServerStreamingServerMethod\<TRequest, TResponse\>](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerStreamingServerMethod-2)

Server-side handler for server streaming call.

### [UnaryServerMethod\<TRequest, TResponse\>](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.UnaryServerMethod-2)

Server-side handler for unary call.

### [VerifyPeerCallback](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.VerifyPeerCallback)

Callback invoked with the expected targetHost and the peer's certificate.
If false is returned by this callback then it is treated as a
verification failure and the attempted connection will fail.
Invocation of the callback is blocking, so any
implementation should be light-weight.
Note that the callback can potentially be invoked multiple times,
concurrently from different threads (e.g. when multiple connections
are being created for the same credentials).