-
Notifications
You must be signed in to change notification settings - Fork 820
Description
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:
- Is this removal intentional starting from 2.76.0?
- If intentional, what is the recommended replacement for GrpcChannel.State / ConnectivityState?
- 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!