question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Grpc.Net.ClientFactory .NETStandard2.0 compatibility

See original GitHub issue

Is your feature request related to a problem? Please describe.

I hava an UWP project which uses Grpc.Net.Client.Web 2.36.0. I see, that this version supports .NETStandard2.0, but the
Grpc.Net.ClientFactory only supports .NETStandard2.1 and net5.0. The UWP doesn’t support 2.1 or .net5 yet.

My problem is I would like to use interceptors for the client side, according to this code:

services
    .AddGrpcClient<Greeter.GreeterClient>(o =>
    {
        o.Address = new Uri("https://localhost:5001");
    })
    .AddInterceptor(() => new SomeInterceptor())   

Describe the solution you’d like

Grpc.Net.ClientFactory .NETStandard2.0 compatibility

Describe alternatives you’ve considered

Closely enough to me that add multiple interceptor with somewhere on these lines:

CallCredentials callCredentials = CallCredentials.FromInterceptor(CHttpClientService.AsyncAuthInterceptor);
    return GrpcChannel.ForAddress(Settings.CSettings.ServerAddress, new GrpcChannelOptions
    {
        HttpHandler = new GrpcWebHandler(new CHttpClientService().PrepareHttpMessageHandler()),
        Credentials = ChannelCredentials.Create(new SslCredentials(), callCredentials),
    });

AsyncAuthInterceptor is not good for me, because it is called only before the function call.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
JamesNKcommented, Mar 19, 2021

netstandard2.0 client factory will be in the next release.

You can add interceptors like this to a channel without client factory:

var channel = GrpcChannel.ForAddress("https://blah");
var invoker = channel.Intercept(new SomeInterceptor());

var client = Greeter.GreeterClient(invoker);

The extension method is in Grpc.Core.Interceptors.ChannelExtensions.

0reactions
HppZcommented, Mar 22, 2021

hope it won’t be long. so sad.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use gRPC client with .NET Standard 2.0
Learn how to use the .NET gRPC client in apps and libraries that support .NET Standard 2.0.
Read more >
Grpc.Net.ClientFactory 2.55.0
Provides a central location for configuring logical gRPC client instances; Manages the lifetime of the underlying HttpClientMessageHandler; Automatic ...
Read more >
Grpc.Net.ClientFactory.csproj
Search code, repositories, users, issues, pull requests... · Provide feedback · Saved searches · Grpc.Net.ClientFactory.csproj ...
Read more >
gRPC for ASP.NET Core 3.0
gRPC in . NET Core 3.0 has first class support by the framework just like using a MVC Controller, SignalR Hub or Razor...
Read more >
Migrating WCF to gRPC using .NET Core - The Seeley Coder
Let's look at migrating WCF to gRPC using .NET Core while still maintaining backwards compatibility. Let's branch the code from Using WCF ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found