title: ServiceFabric / IFabricSecretStoreClient / COM Exception
body: <p>I'm not finding much on this, and after spending most of the day...I'm looking for help..</p>
  
  <p>The exception I get is this:</p>
  
  <blockquote>
    <p>Unable to cast COM object of type 'System.__ComObject' to interface
    type 'IFabricSecretStoreClient'. This operation failed because the
    QueryInterface call on the COM component for the interface with IID
    '{38C4C723-3815-49D8-BDF2-68BFB536B8C9}' failed due to the following
    error: No such interface supported (Exception from HRESULT: 0x80004002
    (E_NOINTERFACE)).</p>
  </blockquote>
  
  <p>I'm able to instantiate the proxy to the Stateful Service with this code:</p>
  
  <pre><code>var servicekey = new ServicePartitionKey(0);
    var queryserviceUri = new Uri("fabric:/XXXX/xxxxxxxxxx");
    var proxyHandle = ServiceProxy.Create&lt;IAnInterfaceName&gt;(queryserviceUri, servicekey, TargetReplicaSelector.PrimaryReplica);
  </code></pre>
  
  <p>Then I use the proxy:</p>
  
  <pre><code>var result = await proxyHandle.OperationOnServiceContract(dataPackage);
  </code></pre>
  
  <p>At this point I get the error...</p>
  
  <p>Stacktrace...</p>
  
  <blockquote>
    <p>at System.Fabric.FabricClient.CreateNativeClient(IEnumerable<code>1
    connectionStringsLocal)    at
    System.Fabric.Interop.Utility.&lt;&gt;c__DisplayClass27_0.&lt;WrapNativeSyncInvoke&gt;b__0()
    at System.Fabric.Interop.Utility.WrapNativeSyncInvoke[TResult](Func</code>1
    func, String functionTag, String functionArgs)    at
    System.Fabric.Interop.Utility.WrapNativeSyncInvoke(Action action,
    String functionTag, String functionArgs)    at
    System.Fabric.Interop.Utility.RunInMTA(Action action)    at
    System.Fabric.FabricClient.InitializeFabricClient(SecurityCredentials
    credentialArg, FabricClientSettings newSettings, String[]
    hostEndpointsArg)    at
    Microsoft.ServiceFabric.Services.Client.ServicePartitionResolver.&lt;>c.b__21_0()
    at
    Microsoft.ServiceFabric.Services.Client.ServicePartitionResolver.GetClient()
    at
    Microsoft.ServiceFabric.Services.Client.ServicePartitionResolver.ResolveHelperAsync(Func<code>5
    resolveFunc, ResolvedServicePartition previousRsp, TimeSpan
    resolveTimeout, TimeSpan maxRetryInterval, CancellationToken
    cancellationToken, Uri serviceUri)    at
    Microsoft.ServiceFabric.Services.Communication.Client.CommunicationClientFactoryBase</code>1.GetClientAsync(Uri
    serviceUri, ServicePartitionKey partitionKey, TargetReplicaSelector
    targetReplicaSelector, String listenerName, OperationRetrySettings
    retrySettings, CancellationToken cancellationToken)    at
    Microsoft.ServiceFabric.Services.Remoting.V2.FabricTransport.Client.FabricTransportServiceRemotingClientFactory.GetClientAsync(Uri
    serviceUri, ServicePartitionKey partitionKey, TargetReplicaSelector
    targetReplicaSelector, String listenerName, OperationRetrySettings
    retrySettings, CancellationToken cancellationToken)    at
    Microsoft.ServiceFabric.Services.Communication.Client.ServicePartitionClient<code>1.GetCommunicationClientAsync(CancellationToken
    cancellationToken)    at
    Microsoft.ServiceFabric.Services.Communication.Client.ServicePartitionClient</code>1.InvokeWithRetryAsync[TResult](Func<code>2
    func, CancellationToken cancellationToken, Type[]
    doNotRetryExceptionTypes)    at
    Microsoft.ServiceFabric.Services.Remoting.V2.Client.ServiceRemotingPartitionClient.InvokeAsync(IServiceRemotingRequestMessage
    remotingRequestMessage, String methodName, CancellationToken
    cancellationToken)    at
    Microsoft.ServiceFabric.Services.Remoting.Builder.ProxyBase.InvokeAsyncV2(Int32
    interfaceId, Int32 methodId, String methodName,
    IServiceRemotingRequestMessageBody requestMsgBodyValue,
    CancellationToken cancellationToken)    at
    Microsoft.ServiceFabric.Services.Remoting.Builder.ProxyBase.ContinueWithResultV2[TRetval](Int32
    interfaceId, Int32 methodId, Task</code>1 task)    at
    XXXXWeb.Controllers.XXXController.OperationOnServiceContract(XXXRequest
    xxxRequest) in
    C:\Users\codputer\Source\Repos\xxxxxx\xxxx.Web\Controllers\XXXController.cs:line
    44</p>
  </blockquote>
  
  <p>oh I'm using this for a listener:</p>
  
  <pre><code>protected override IEnumerable&lt;ServiceReplicaListener&gt; CreateServiceReplicaListeners()
  {
    return this.CreateServiceRemotingReplicaListeners();
  }
  </code></pre>