升级包后的Service Fabric远程调用

问题描述 投票:0回答:1

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

找不到字段:'Microsoft.ServiceFabric.Services.ServiceTrace.Source'。

堆栈跟踪:

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

这是一个调用(我尝试修复它的一个尝试是使用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));
}

任何的想法?谢谢

c# azure-service-fabric
1个回答
0
投票

认为

你能检查一下你的其他SF nuget包版本吗?是否与6.3.162相同?您正在使用哪个SF运行时版本?

© www.soinside.com 2019 - 2024. All rights reserved.