You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ServiceContract]publicinterfaceIService{// method: POST /IService/SomeOperation[OperationContract]
Task SomeOperation();}[ServiceContract]publicinterfaceIConcreteService1:IService{/* skip other operations ... */}[ServiceContract]publicinterfaceIConcreteService2:IService{/* skip other operations ... */}classConcreteService1:IConcreteService1{public Task SomeOperation(){/* do something in the context of ConcreteService1 */}}classConcreteService2:IConcreteService2{public Task SomeOperation(){/* do something else in the context of ConcreteService2 */}}// register /IService/SomeOperation
endpoints.MapGrpcService<ConcreteService1>();// /IService/SomeOperation is already registered by ConcreteService1
endpoints.MapGrpcService<ConcreteService2>();
Boths ConcreteService1 and ConcreteService2 try to register the same endpoint /IService/SomeOperation and it leads to a naming conflict. For details see ServiceModel.Grpc service and operation names.
If an interface does not contain [ServiceContract], the service name for each defined operation comes from the root [ServiceContract] interface, in the provided example root interfaces are IConcreteService1 and IConcreteService2
The text was updated successfully, but these errors were encountered:
Problem
Boths
ConcreteService1
andConcreteService2
try to register the same endpoint/IService/SomeOperation
and it leads to a naming conflict. For details see ServiceModel.Grpc service and operation names.Solution
Remove ServiceContract attribute from IService.
If an interface does not contain [ServiceContract], the service name for each defined operation comes from the root [ServiceContract] interface, in the provided example root interfaces are
IConcreteService1
andIConcreteService2
The text was updated successfully, but these errors were encountered: