I am getting the below error. I have added required nuget package Microsoft.ServiceFabric.Services.Remoting v3.0.472.
'VotingDataService' does not contain a definition for 'CreateServiceRemotingListener' and no extension method 'CreateServiceRemotingListener' accepting a first argument of type 'VotingDataService' could be found (are you missing a using directive or an assembly reference?)
using Microsoft.ServiceFabric.Services.Communication.Runtime;
using Microsoft.ServiceFabric.Services.Remoting;
using Microsoft.ServiceFabric.Services.Remoting.Runtime;
using Microsoft.ServiceFabric.Services.Runtime;
using System;
using System.Collections.Generic;
using System.Fabric;
using System.Threading.Tasks;
namespace VotingDataService
{
public interface IVotingDataService2 : IService
{
Task<int> AddVote(string voteItem);
}
/// <summary>
/// The FabricRuntime creates an instance of this class for each service type instance.
/// </summary>
internal sealed class VotingDataService : StatefulService, IVotingDataService2
{
public VotingDataService(StatefulServiceContext context)
: base(context)
{ }
public Task<int> AddVote(string voteItem)
{
throw new NotImplementedException();
}
protected override IEnumerable<ServiceReplicaListener> CreateServiceReplicaListeners()
{
return new[]
{
new ServiceReplicaListener(context =>
this.CreateServiceRemotingListener(context))
};
}
}
}