Skip to content

Regression since 2.76.0: ConnectivityState and GrpcChannel.State no longer available from Grpc.Net.Client #2684

@mikasoukhov

Description

@mikasoukhov

Hi team,

Starting with Grpc.Net.Client 2.76.0 (NuGet: Grpc.Net.Client), it looks like the public enum ConnectivityState and the property GrpcChannel.State are no longer exposed/available to consumers.

From reading the code, this seems related to load balancing support being conditionally excluded for .NET 6 (or certain TFMs). This is a bit surprising, because load balancing used to work / be supported before.

My current hypothesis is that this happened as a side effect of shifting the minimum supported runtime to .NET 8, and some code paths became gated behind conditional compilation symbols that effectively hide these APIs for older TFMs. However, it’s confusing because the package still targets .NET Standard 2.0, which covers .NET 6, and .NET 6 likely still has the underlying support for load balancing — but the API ends up unavailable due to incorrect (or overly strict) conditional compilation.

More broadly, removing public API surface in a future version is not a great experience for consumers. Usually this is handled by:

keeping the API but gating behavior at runtime, or

  • using conditional compilation to keep it but emit an [Obsolete] warning / analyzer guidance first, rather than removing it outright.
  • Even with that approach, hiding it specifically for .NET 6+ looks unnecessary and potentially incorrect.

Could you please confirm:

  1. Is this removal intentional starting from 2.76.0?
  2. If intentional, what is the recommended replacement for GrpcChannel.State / ConnectivityState?
  3. If not intentional, could this be fixed by adjusting the conditional compilation / TFM guards so that .NET 6 consumers still get the API surface?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions