0

该行wcfServiceObject:this给出了一个错误cannot convert from ... to ...

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/

4

1 回答 1

0

我认为我应该interface为我的服务实施。就像下面的示例一样ShoppingCartService

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

在这种特殊情况下,我必须IShoppingCartServiceShoppingCartService.

于 2016-10-01T08:36:46.463 回答