-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OperationDescriptorBuilder does not contain ctor with 2 parameters Linux-Docker #307
Comments
Thank you for the bug report.
It seems that ctor was removed by trimming. Blazor WebAssembly performs IL trimming to reduce the size of the published output. Trimming occurs when publishing an app. Consider switching to source code generation by ServiceModel.Grpc.DesignTime in your project, see ServiceModel.Grpc client code generation, example. |
You are welcome, 1- As the triming link describe trimming config, if we disable 2- Or instead using but I am still confused why published app is working well on Windows Docker but had problem in Linux OS Docker, |
The issue was reproducible on windows and Linux: The fix was released in version 1.12.0. FYI Examples/BlazorApp/Client is changed to use |
Describe the bug
Using last versionas 1.11.1 and the exception is throwing in Linux-Docker as:
Unhandled exception rendering component: OperationDescriptorBuilder does not contain ctor with 2 parameters. System.ArgumentException: OperationDescriptorBuilder does not contain ctor with 2 parameters. at ServiceModel.Grpc.Emit.ReflectionTools.Constructor(Type type, Int32 parametersCount) at ServiceModel.Grpc.Emit.CodeGenerators.ReflectDescriptor..ctor() at ServiceModel.Grpc.Emit.CodeGenerators.EmitContractBuilder.Build(ModuleBuilder moduleBuilder, ContractDescription1 description, String className) at ServiceModel.Grpc.Emit.EmitGenerator.GenerateContract(Type serviceType, ILogger logger) at ServiceModel.Grpc.Emit.EmitGenerator.GenerateClientBuilder[ITestService](ILogger logger) at ServiceModel.Grpc.Client.ClientRegistration.EmitBuilder[ITestService](ILogger ) at ServiceModel.Grpc.Client.ClientRegistration.Build[ITestService](IClientBuilder1 , ServiceModelGrpcClientOptions , Action1 ) at ServiceModel.Grpc.Client.ClientFactory.RegisterClient[ITestService](IClientBuilder1 , Action1 , Boolean ) at ServiceModel.Grpc.Client.ClientFactory.CreateClient[ITestService](CallInvoker ) at ServiceModel.Grpc.Client.ClientFactory.CreateClient[ITestService](ChannelBase ) at ServiceModel.Grpc.Client.GrpcClientExtensions.<>c__01[[Server.ITestService, Server.Infra, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]].b__0_0(IServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite , RuntimeResolverContext ) at
To Reproduce
I did some investigation and set log in
public static ConstructorInfo Constructor(this Type type, int parametersCount)
like below:and see
==> Creating OperationDescriptorBuilder Found Ctor Length:0, Expected Params Count:2
Expected behavior
Supposed that
ReflectDescriptor
can create thector
ofOperationDescriptorBuilder
by reflection, everything working well on Development Env and Windows Docker Desktop whether Linux or Windows Mode, but in Linux Docker OS above mentioned Exception is throwing, we had to downgrade to version 1.8Environment
Additional context
Why
var constructors = type.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
can not create or find actor
with two parameters ofOperationDescriptorBuilder
which is exist and implemented.The text was updated successfully, but these errors were encountered: