While following the tutorial in Programming Azure Service Fabric about creating a WcfCommunicationClient of the calculator service I stumbled upon a problem that I can't find the answer to.
The code is about the same as in the book and the service (WCF) is created like this:
protected override IEnumerable<ServiceInstanceListener> CreateServiceInstanceListeners()
{
return new[]
{
new ServiceInstanceListener(initParams => new WcfCommunicationListener<ICalculatorService>(initParams, this, WcfUtility.CreateTcpListenerBinding(), "ServiceEndpoint"))
};
}
When the service is called the first time, the call hangs forever and the service fabric explorer gives the following error + stacktrace:
Unhealthy event: SourceId='System.RA', Property='ReplicaOpenStatus', HealthState='Warning', ConsiderWarningAsError=false. Replica had multiple failures during open. Error =System.InvalidOperationException (-2146233079) Poging om contracttype voor ICalculatorService te verkrijgen, maar dat type is geen ServiceContract en neemt ook geen ServiceContract over. bij System.ServiceModel.Description.ServiceReflector.GetContractTypeAndAttribute(Type interfaceType, ServiceContractAttribute& contractAttribute) bij System.ServiceModel.Description.TypeLoader.LoadContractDescriptionHelper(Type contractType, Type serviceType, Object serviceImplementation) bij System.ServiceModel.Description.ContractDescription.GetContract(Type contractType) bij Microsoft.ServiceFabric.Services.Communication.Wcf.Runtime.WcfCommunicationListener
1.CreateServiceEndpoint(Type contractType, Binding binding, EndpointAddress address) bij Microsoft.ServiceFabric.Services.Communication.Wcf.Runtime.WcfCommunicationListener
1..ctor(ServiceContext serviceContext, TServiceContract wcfServiceObject, Binding listenerBinding, EndpointAddress address, String endpointResourceName) bij Microsoft.ServiceFabric.Services.Communication.Wcf.Runtime.WcfCommunicationListener`1..ctor(ServiceContext serviceContext, TServiceContract wcfServiceObject, Binding listenerBinding, String endpointResourceName) bij CalculatorService.CalculatorService.b__3_0(StatelessServiceContext initParams) in C:\Users\servel\documents\visual studio 2015\Projects\CalculatorApplication\CalculatorService\CalculatorService.cs:regel 45 bij Microsoft.ServiceFabric.Services.Runtime.StatelessServiceInstanceAdapter.d__10.MoveNext() bij System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bij System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bij Microsoft.ServiceFabric.Services.Runtime.StatelessServiceInstanceAdapter.d__0.MoveNext()
Apparently the service cant be started. So what to do to fix this?