【问题标题】:wcfServiceObject:this cannot convert errorwcfServiceObject:这无法转换错误
【发布时间】:2017-02-09 19:13:18
【问题描述】:

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/

【问题讨论】:

    标签: wcf azure-service-fabric service-fabric-stateful


    【解决方案1】:

    我认为我应该为我的服务实现interface。就像下面的 ShoppingCartService 示例:

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

    在这种特殊情况下,我必须为ShoppingCartService 实现IShoppingCartService 接口。

    【讨论】:

      猜你喜欢
      • 2013-11-15
      • 1970-01-01
      • 1970-01-01
      • 2020-08-14
      • 2019-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-07
      相关资源
      最近更新 更多