title: Service Fabric, Remoting V2 to Stateful Service not working
body: <p>I can't get this working, I've googled and probably found every page on how to do this, all two of them!</p>
  
  <p>Basically I'm just trying to get SF Remoting V2 working from a stateless .NET Core 2 MVC App' to a Statefull service. </p>
  
  <p>Here's what I have done:</p>
  
  <p>Client Code in Controller: (Simplified as much as Possible):</p>
  
  <pre><code>public class ValuesController : Controller
  {
  
      [HttpGet]
      public async Task&lt;IEnumerable&lt;string&gt;&gt; Get()
      {
  
           // Provide certificate details.
          var serviceProxyFactory = new ServiceProxyFactory((c) =&gt; new FabricTransportServiceRemotingClientFactory());
  
          var proxy = serviceProxyFactory.CreateServiceProxy&lt;ICallMe&gt;(new Uri("fabric:/SFExperiment/Stateful1"));
  
          var value3 = await proxy.GetGreeeting("Bob");
  
          return new[] { "value1", "value2", value3 };
      }
  </code></pre>
  
  <p>Service Code Interface:</p>
  
  <pre><code>using System.Threading.Tasks;
  using Microsoft.ServiceFabric.Services.Remoting;
  using Microsoft.ServiceFabric.Services.Remoting.FabricTransport;
  
  
  [assembly: FabricTransportServiceRemotingProvider(RemotingListener = 
  RemotingListener.V2Listener, RemotingClient = RemotingClient.V2Client)]
  
  namespace Stateful1.Abstractions
  {
  
   public interface ICallMe : IService
   {
       Task&lt;string&gt; GetGreeeting(string name);
   }
  }
  </code></pre>
  
  <p>Service Code: </p>
  
  <pre><code>    Public sealed class Stateful1 : StatefulService, ICallMe
  {
      public Stateful1(StatefulServiceContext context)
          : base(context)
      { }
  
      protected override IEnumerable&lt;ServiceReplicaListener&gt; CreateServiceReplicaListeners()
      {
          return this.CreateServiceRemotingReplicaListeners();
      }
  
      public Task&lt;string&gt; GetGreeeting(string name)
      {
          return Task.FromResult(@"Congratulations, you have remoting working. :-) ");
      }
  </code></pre>
  
  <p>I have added below to ServiceManifest.xml</p>
  
  <pre><code>  &lt;Resources&gt;
  &lt;Endpoints&gt;
    &lt;!-- To enable Service remonting for remoting services V2--&gt;
    &lt;Endpoint Name="ServiceEndpointV2" /&gt;
  
    &lt;Endpoint Name="ReplicatorEndpoint" /&gt;
  &lt;/Endpoints&gt;
  &lt;/Resources&gt;
  </code></pre>
  
  <p>And it doesn't work.. I get the following Exception:</p>
  
  <p><strong>Invalid partition key/ID '{0}'  for selector {1}</strong></p>
  
  <p>What am I doing wrong?</p>