This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{63EBCF4C-B326-4539-A3CB-B50746D6C323}’ failed

If you’re running a code like this:

builder.Services.TryAddSingleton<FabricClient>();

In a Service Fabric application locally and getting an error:

System.InvalidCastException:
Unable to cast COM object of type ‘System.__ComObject’ to interface type ‘IInternalFabricClusterManagementClient2’.
This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{63EBCF4C-B326-4539-A3CB-B50746D6C323}’ failed due to the following error: No such interface supported (0x80004002 (E_NOINTERFACE)).’

First what you need to do is to convert it to something like this:

builder.Services.TryAddSingleton<FabricClient>(_ => new FabricClient());

The exception’s call site would be located in the user’s code, not the framework’s so you could see the actual exception and its stack trace.

The exception likely occurs because the NuGet package referenced from the Service Fabric service project, e.g.:

<PackageReference Include="Microsoft.ServiceFabric" Version="9.1.1390" />

Has diverged from the Service Fabric SDK installed locally, e.g:

You need to install the matching SDK version from here.

This entry was posted in Programming and tagged . Bookmark the permalink.

1 Response to This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{63EBCF4C-B326-4539-A3CB-B50746D6C323}’ failed

  1. Andrew's avatar Andrew says:

    This was very helpful thanks we have the same exact issue, on our environments, worked fine on local so installed 9.1.1390.9590

Leave a reply to Andrew Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.