【发布时间】:2018-07-29 17:11:22
【问题描述】:
我正在使用 Azure Service Fabric 和控制台应用程序。我只是想让我的控制台应用程序连接到集群并做一些事情。
控制台应用尝试使用以下内容解析服务地址:
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();
}
我的问题是resolver.ResolveAsync 抛出了一个似乎与 Service Fabric 没有任何联系的异常:
无法将“System.__ComObject”类型的 COM 对象转换为接口 键入“IFabricApplicationManagementClient10”。此操作失败 因为接口的 COM 组件上的 QueryInterface 调用 IID 为“{67001225-D106-41AE-8BD4-5A0A119C5C01}”失败,原因是 以下错误:不支持此类接口(来自 HRESULT 的异常: 0x80004002 (E_NOINTERFACE))。
对此有什么想法吗?
更新
我没有很清楚地解释我的问题以及我想要实现的目标。
我正在使用 Azure Service Fabric(无状态服务和有状态服务):我的问题是:调用托管在 Azure Service Fabric 中的微服务的最佳方式是什么?
问候, 阿提利奥
【问题讨论】:
-
很可能是由于 nuget 包版本在您拥有的(较新的)集群拥有的(较旧的)之间不匹配。尝试将 Microsoft.ServiceFabric nuget 包降级到较低版本。
标签: c# dns azure-service-fabric