行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()
)
)};
如何解决此问题?
答案 0 :(得分:0)
我认为我应该为我的服务实施interface
。如下面的示例ShoppingCartService
:
internal sealed class ShoppingCartService : StatefulService, IShoppingCartService
{
...
}
在这种特殊情况下,我必须为IShoppingCartService
实现ShoppingCartService
界面。