升级软件包后,Service Fabric远程调用

时间:2018-07-17 13:56:56

标签: c# azure-service-fabric

我刚刚将我的SF软件包升级到了最新版本(6.3.162)。昨天对我的服务的调用工作正常,现在都崩溃了,并显示以下错误:

  

未找到字段:“ Microsoft.ServiceFabric.Services.ServiceTrace.Source”。

堆栈跟踪:

  Microsoft.ServiceFabric.Services.Remoting.V2.Builder.InterfaceDetailsS​​tore.UpdateKnownTypes中的

(Int32 interfaceId,String interfaceName,InterfaceDetailsknownTypes)      在Microsoft.ServiceFabric.Services.Remoting.V2.Builder.InterfaceDetailsS​​tore.UpdateKnownTypesDetails(IEnumerable`1 interfaceDescriptions)      在Microsoft.ServiceFabric.Services.Remoting.V2.Builder.ServiceCodeBuilder.BuildProxyGenerator(Type interfaceType)      在Microsoft.ServiceFabric.Services.Remoting.Builder.CodeBuilder.Microsoft.ServiceFabric.Services.Remoting.Builder.ICodeBuilder.GetOrBuildProxyGenerator(Type interfaceType)处      在Microsoft.ServiceFabric.Services.Remoting.V2.Builder.ServiceCodeBuilder.GetOrCreateProxyGenerator(类型serviceInterfaceType)      在Microsoft.ServiceFabric.Services.Remoting.V2.Client.ServiceProxyFactory.CreateServiceProxy [TServiceInterface](Uri serviceUri,ServicePartitionKey partitionKey,TargetReplicaSelector targetReplicaSelector,字符串listenerName)      在Microsoft.ServiceFabric.Services.Remoting.Client.ServiceProxyFactory.CreateServiceProxy [TServiceInterface](Uri serviceUri,ServicePartitionKey partitionKey,TargetReplicaSelector targetReplicaSelector,字符串listenerName)      在Inovatic.SF.Windows.Facade.Controllers.PaymentController。<> c__DisplayClass6_0。 d.MoveNext()

这里是一个调用(我试图解决的一个尝试是尝试使用v2远程处理堆栈进行调用,所以我不确定这是否可行):

    [HttpGet]
    public async Task<IActionResult> GetCustomerId(string mail)
    {
        return await TelemetryManager.ServiceRemotingDependencyCallAsync<IActionResult>(async () =>
            {
                try
                {
                    //var proxy = ServiceProxy
                    //    .Create<IPayment>(_paymentServiceUri);

                    var proxyFactory = new ServiceProxyFactory(c => 
                        new FabricTransportServiceRemotingClientFactory());

                    var proxy = proxyFactory.CreateServiceProxy<IPayment>(_paymentServiceUri);

                    var customerId = await proxy
                        .GetStripeCustomerIdAsync(mail)
                        .ConfigureAwait(false);

                    return Ok(customerId);
                }
                catch (Exception e)
                {
                    return BadRequest(e.InnerException);
                }

            },
            dependencyType: DependencyType.StatelessService,
            dependencyName: DependencyName.PaymentService,
            target: _paymentServiceUri.ToString())
            .ConfigureAwait(false);
    }

服务称为:

manifest : 
<Endpoints>
  <!--<Endpoint Name="ServiceEndpoint" />-->
  <Endpoint Name="ServiceEndpointV2" />  
</Endpoints>

payment.cs contains
[assembly: FabricTransportServiceRemotingProvider(RemotingListenerVersion = RemotingListenerVersion.V2, RemotingClientVersion = RemotingClientVersion.V2)]

protected override IEnumerable<ServiceInstanceListener> CreateServiceInstanceListeners()
{
    //yield return new ServiceInstanceListener(this.CreateServiceRemotingListener);
    //return this.CreateServiceRemotingInstanceListeners();
    yield return new ServiceInstanceListener(c => new FabricTransportServiceRemotingListener(c, this));
}

有什么主意吗?谢谢

1 个答案:

答案 0 :(得分:0)

Xav

您可以检查其他SF nuget软件包的版本吗?都和6.3.162一样吗? 以及您正在使用哪个SF运行时版本?