Skip to content

Fix client factory extension method validation issues - #2159

Merged
JamesNK merged 1 commit into
grpc:masterfrom
JamesNK:jamesnk/clientfactory-extension-validation
Jun 14, 2023
Merged

Fix client factory extension method validation issues#2159
JamesNK merged 1 commit into
grpc:masterfrom
JamesNK:jamesnk/clientfactory-extension-validation

Conversation

@JamesNK

@JamesNK JamesNK commented Jun 13, 2023

Copy link
Copy Markdown
Member

Fixes #2158

  • Extension methods now work when AddGrpcClient is called without configuration
  • Extension methods now report the failing method name correctly (I made it explicit instead of an attribute to avoid someone unknowingly accidentally regressing the error name)

@JamesNK

JamesNK commented Jun 13, 2023

Copy link
Copy Markdown
Member Author

FYI @jviau

You can temporarily work around the issue by using an AddGrpcClient overload that includes a configuration parameter and provide an empty one.

@jviau jviau left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix! And yes, I am using the .AddGrpcClient(_ => { }) for now.

Comment thread src/Grpc.Net.ClientFactory/GrpcHttpClientBuilderExtensions.cs

@mgravell mgravell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved with one optional suggestion

edit: I just noticed the "(I made it explicit instead of an attribute to avoid someone unknowingly accidentally regressing the error name)" (sorry, words are hard!) - noted, so: you considered it, dismissed it, and gave a reason; fine

@JamesNK
JamesNK merged commit 73c726b into grpc:master Jun 14, 2023
@JamesNK
JamesNK deleted the jamesnk/clientfactory-extension-validation branch June 14, 2023 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InvalidOperationException when configuring gRPC client (Grpc.Net.ClientFactory)

3 participants