2016-10-01 70 views
0

wcfServiceObject:this给出了一个错误cannot convert from ... to ...wcfServiceObject:这不能转换错误

return new[] { new ServiceReplicaListener((context) => 
    new WcfCommunicationListener<IShoppingCartService>(
     wcfServiceObject:this, 
     serviceContext:context, 
     // 
     // The name of the endpoint configured in the ServiceManifest under the Endpoints section 
     // that identifies the endpoint that the WCF ServiceHost should listen on. 
     // 
     endpointResourceName: "WcfServiceEndpoint", 

     // 
     // Populate the binding information that you want the service to use. 
     // 
     listenerBinding: WcfUtility.CreateTcpListenerBinding() 
    ) 
)}; 

如何解决此问题?

代码来自:https://azure.microsoft.com/nl-nl/documentation/articles/service-fabric-reliable-services-communication-wcf/

回答

0

我想,我应该实现interface为我服务。像下面的ShoppingCartService的例子:

internal sealed class ShoppingCartService : StatefulService, IShoppingCartService 
{ 
    ... 
} 

在这种特殊情况下,我不得不实施IShoppingCartService接口,为ShoppingCartService

相关问题