ProxyEmitter | Generate C # proxy class at run-time with ILGenerator | Proxy library
kandi X-RAY | ProxyEmitter Summary
kandi X-RAY | ProxyEmitter Summary
In C#, we often run into objects or services that provide dynmaic method invocation by a single method like:. It is good practice to create a proxy class that wraps all remote methods and call the Invoke method internally to provide strong typed interface.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ProxyEmitter
ProxyEmitter Key Features
ProxyEmitter Examples and Code Snippets
Community Discussions
Trending Discussions on ProxyEmitter
QUESTION
I am getting the following exception:
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: The type initializer for 'DefaultProxyCache
1' threw an exception. System.TypeInitializationException: The type initializer for 'DefaultProxyCache
1' threw an exception. ---> System.ArgumentException: Invalid generic arguments Parameter name: typeArguments at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.MakeGenericMethod_impl(System.Reflection.RuntimeMethodInfo,System.Type[]) at System.Reflection.RuntimeMethodInfo.MakeGenericMethod (System.Type[] methodInstantiation) <0x342def8 + 0x000d6> in :0 at ProtoBuf.Grpc.Internal.ContractOperation.TryGetClientHelper () [0x0001b] in //src/protobuf-net.Grpc/Internal/ContractOperation.cs:291 at ProtoBuf.Grpc.Internal.ProxyEmitter.EmitFactory[TService] (ProtoBuf.Grpc.Configuration.BinderConfiguration binderConfig) [0x00477] in //src/protobuf-net.Grpc/Internal/ProxyEmitter.cs:238 at ProtoBuf.Grpc.Internal.ProxyEmitter.CreateFactory[TService] (ProtoBuf.Grpc.Configuration.BinderConfiguration binderConfig) [0x0006d] in //src/protobuf-net.Grpc/Internal/ProxyEmitter.cs:123 at ProtoBuf.Grpc.Configuration.ClientFactory+DefaultProxyCache`1[TService]..cctor () [0x00000] in //src/protobuf-net.Grpc/Configuration/ClientFactory.cs:81
My project uses gRPC-Web, Blazor web assembly and protobuf-net
This is my service contract:
...ANSWER
Answered 2020-Jul-07 at 07:38That is... odd. I can't repro it here, so I'm guessing it is something specific to Blazor. I've checked what the code does in the "regular" frameworks, and at least for me it seems to do the right things - using UnaryValueTaskAsync()
and UnaryValueTaskAsync()
, which is what I would expect. I've improved the exception handling in that code path, to at least give us a clue what it is trying to do, so my suggestion is:
- update to
protobuf-net.Grpc
version >= 1.0.119 (I'll get it deployed as soon as CI finishes) - retry, and let me know exactly what it says now
Alternatively, if you have a minimal repro including the blazor bits on, say, a GitHub repo, I can happily take a look there.
(tip: I try to keep an eye on both Stack Overflow and GitHub, but GitHub is probably more appropriate for this kind of question - I'd happily say that this is a bug, so: https://github.com/protobuf-net/protobuf-net.Grpc/issues)
QUESTION
I am using protobuf-net with protobuf-net.grpc and am attempting to get it to work on Xmarin/Ios.
Currently I have attempted to create a pre-compiled serializer:
...ANSWER
Answered 2020-Jun-25 at 17:13A second read on this reveals that you're actually looking for gRPC support. This is actually possible right now - you just need to provide a custom binder config:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ProxyEmitter
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page