Rob Bagby
Rob Bagby

Reputation: 139

Service Fabric - MissingMethodException ClearAsync()

I am using Microsoft.ServiceFabric version 5.1.163. I have a very simple StatefulService. The constructor fails with a MissingMethodException: "Method not found: 'System.Threading.Tasks.Task Microsoft.ServiceFabric.Data.IReliableStateManager.ClearAsync()'."

Here is the code:

    internal sealed class ShoppingCartService : StatefulService, IShoppingCartService
    {
        public ShoppingCartService(StatefulServiceContext context)
            : base(context)
        { }

        /// <summary>
        /// Optional override to create listeners (e.g., TCP, HTTP) for this service replica to handle client or user requests.
        /// </summary>
        /// <returns>A collection of listeners.</returns>
        protected override IEnumerable<ServiceReplicaListener> CreateServiceReplicaListeners()
        {
            return new ServiceReplicaListener[]
            {
                new ServiceReplicaListener(context =>
                    new WcfCommunicationListener<IShoppingCartService>(wcfServiceObject:this,
                        serviceContext:context,
                        endpointResourceName:"ScServiceEndpoint",
                        listenerBinding:WcfUtility.CreateTcpListenerBinding())
            )};
        }
        ...

The exception is raised in the base ctor.

Upvotes: 0

Views: 481

Answers (1)

alltej
alltej

Reputation: 7285

Is your runtime SF using the same version as the nuget package of the project?

Upvotes: 5

Related Questions