Closed dgrimmin closed 4 years ago
Are you using NuGet or Paket? And yes GRPC is netcore3.x and above only.
Paket, so I have been diving into the paket.lock file until my head was spinning. I am really hoping for some high levels settings to magically appear as a possible solution.
Could you post the lock file (and / or a basic repro repository?). Thanks!
Hi Isaac,
Thank you for wanting to help.
Here I created a minimal example https://github.com/dgrimmin/saturn-grpc-issue .
fake build dotnet .\src\gRpcSample\bin\Release\netcoreapp3.0\gRpcSample.dll
Application startup exception: System.MissingMethodException: Method not found: Microsoft.AspNetCore.Builder.IEndpointConventionBuilder Microsoft.AspNetCore.Builder.GrpcEndpointRouteBuilderExtensions.MapGrpcService(Microsoft.AspNetCore.Routing.IEndpointRouteBuilder). at Saturn.configureGrpcEndpoint@21-1.Invoke(IEndpointRouteBuilder endpoints) at Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions.UseEndpoints(IApplicationBuilder builder, Action1 configure) at Saturn.configureGrpcEndpoint@21.Invoke(IApplicationBuilder app)
I hope you are able to help.
@dgrimmin I can repro here (I killed the lockfile and recreated just in case). Can you compare with this: https://github.com/protobuf-net/protobuf-net.Grpc/tree/master/examples/pb-net-grpc (which doesn't use saturn) - what's the difference? Perhaps convert the F# packages here with Paket and see what changes.
I think referencing Giraffe 4 will fix this, related: https://github.com/SaturnFramework/Saturn/issues/201
@slang25 could be. I'd love to better understand why it's happening nonetheless.
Actually it's a little different to what I thought.
It is expecting the return type on MapGrpcService
to be different from what's in v2.23.2 :
https://github.com/grpc/grpc-dotnet/blob/v2.23.2/src/Grpc.AspNetCore.Server/GrpcEndpointRouteBuilderExtensions.cs#L39
Saturn.Extensions.gRPC
has been compiled against a lower version which is not binary compatible. This could be fixed by lower the Grpc.AspNetCore.Server
in Saturn, or rebuilding with a newer minimum.
Thank you for the insights. This is in line with the feeling I got when diving into the paket.lock files of the saturn repo and my own project.
I really hope this will provide the fix for the grpc extension. I’d love to start using it in production.
@slang25 right. Do you know which version of the nuget package uses the "correct" (i.e. old!) version? That way at least @dgrimmin could be unblocked in the immediate term.
@slang25, what is keeping you from answering Isaac’s? Anything I can do to help?
@dgrimmin I tried but failed to figure out the right combination of package versions. I'll try again and let you know how I get on. What I first tried logically should have worked, so I'm missing something here.
@slang25, your effort is much appreciated! If there are checks I can perform, please let me know.
I think this should be solved with Giraffe 4.X and Saturn targeting netcoreapp3.1
Let me start by saying the grpc extension is a really valuable addition to the Saturn framework, which is itself a pleasure to work with.
I get the grpc sample to work when I clone the gitrepo. It even nicely supports seq(float) that I require. It is so cool you only need to annotate the shared types to get grpc to work.
However, when I want to incorporate the saturn grpc extension in my project I get an error:
"[...]Application startup exception: System.MissingMethodException: Method not found: 'Microsoft.AspNetCore.Builder.IEndpointConventionBuilder Microsoft.AspNetCore.Builder.GrpcEndpointRouteBuilderExtensions.MapGrpcService(Microsoft.AspNetCore.Routing.IEndpointRouteBuilder)[...]"
Which I recon is a versioning thing according to https://github.com/grpc/grpc-dotnet/issues/246 .
This happens when I take the grpc example content and I reference Saturn and Saturn.Extensions.grpc. All is well according to intellisense (datatype-wise), but during runtime I get the above crash.
Any suggestions on how to manage the (transitive) package versions would be much appreciated. I am targetting netcoreapp3.0 as it seems to be a minimum requirement for grpc.