title: Call Azure Service Fabric from outside
body: <p>I'm playing with Azure Service Fabric and a console app. I simply want my console app to connect to the cluster and do some stuff.</p>
  
  <p>The console app try to resolve the service address with the following:</p>
  
  <pre><code>    static void Main(string[] args)
      {
          ServicePartitionResolver resolver = null;
  
          try
          {
              resolver = new ServicePartitionResolver(
                  new string[] {
                      "localhost:19000",
                      "localhost:19001"
                  });
  
              Uri serviceUri = new Uri("fabric:/StatefullServiceTEST/MyStatefulService");
              ResolvedServicePartition partition = resolver.ResolveAsync(serviceUri, new ServicePartitionKey(), CancellationToken.None).GetAwaiter().GetResult();
          }
          catch (Exception ex)
          {
              Console.WriteLine($"Exception: {ex.Message}");
          }
          Console.WriteLine();
          Console.Write("Press any key to exit...");
          Console.ReadKey();
      }
  </code></pre>
  
  <p>My problem is that <code>resolver.ResolveAsync</code> throws an exception that doesn't seem to have any connection with Service Fabric:</p>
  
  <blockquote>
    <p>Unable to cast COM object of type 'System.__ComObject' to interface
    type 'IFabricApplicationManagementClient10'. This operation failed
    because the QueryInterface call on the COM component for the interface
    with IID '{67001225-D106-41AE-8BD4-5A0A119C5C01}' failed due to the
    following error: No such interface supported (Exception from HRESULT:
    0x80004002 (E_NOINTERFACE)).</p>
  </blockquote>
  
  <p>Any ideas on this?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I was not so clear explaining my problem and what I want to achive.</p>
  
  <p>I'm playing with Azure Service Fabric (both stateless and stateful services): my question is: what's the best way to call a micro service hosted in Azure Service Fabric?</p>
  
  <p>Regards,
  Attilio</p>